MVC Pattern, ViewModels, Location of conversion.
Posted
by
Pino
on Programmers
See other posts from Programmers
or by Pino
Published on 2011-01-23T17:38:08Z
Indexed on
2011/01/29
7:33 UTC
Read the original article
Hit count: 438
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.
© Programmers or respective owner