Skip to main content
Tweeted twitter.com/StackSoftEng/status/1537857608484265991
corrected spelling
Source Link
Nicole
  • 28.3k
  • 12
  • 101
  • 143

MVC Pattern, ViewModels, Location of convertionconversion.

I've been working with ASP.Net MVC for arondaround a year now and have created my applications in the following way.

X.Web - MVC Application Contains Controller and Views

X.Lib - Contains Data AccesssAccess, RepositorysRepositories and Services.

This allows us to drop the .Lib into any application that requires it.

At the moment we are using Entity Framework, the conversion from EntityO to a more specific model is done in the controller.

This set-up meensmeans if a service method returns an EntityO and then the Controller will do a conversion before the data is passed to a view.

I'm interested to know if I should move the conversion to the Service so that the app doesntdoesn't have Entity Objects being passed around.

MVC Pattern, ViewModels, Location of convertion.

I've been working with ASP.Net MVC for arond a year now and have created my applications in the following way.

X.Web - MVC Application Contains Controller and Views

X.Lib - Contains Data Accesss, Repositorys and Services.

This allows us to drop the .Lib into any application that requires it.

At the moment we are using Entity Framework, the conversion from EntityO to a more specific model is done in the controller.

This set-up meens if a service method returns an EntityO and then the Controller will do a conversion before the data is passed to a view.

I'm interested to know if I should move the conversion to the Service so that the app doesnt have Entity Objects being passed around.

MVC Pattern, ViewModels, Location of conversion.

I've been working with ASP.Net MVC for around a year now and have created my applications in the following way.

X.Web - MVC Application Contains Controller and Views

X.Lib - Contains Data Access, Repositories and Services.

This allows us to drop the .Lib into any application that requires it.

At the moment we are using Entity Framework, the conversion from EntityO to a more specific model is done in the controller.

This set-up means if a service method returns an EntityO and then the Controller will do a conversion before the data is passed to a view.

I'm interested to know if I should move the conversion to the Service so that the app doesn't have Entity Objects being passed around.

Source Link
LiamB
  • 678
  • 1
  • 7
  • 16

MVC Pattern, ViewModels, Location of convertion.

I've been working with ASP.Net MVC for arond a year now and have created my applications in the following way.

X.Web - MVC Application Contains Controller and Views

X.Lib - Contains Data Accesss, Repositorys and Services.

This allows us to drop the .Lib into any application that requires it.

At the moment we are using Entity Framework, the conversion from EntityO to a more specific model is done in the controller.

This set-up meens if a service method returns an EntityO and then the Controller will do a conversion before the data is passed to a view.

I'm interested to know if I should move the conversion to the Service so that the app doesnt have Entity Objects being passed around.