I have a “small” enterprise application, aspnet mvc 3 + entity framework with POCO entity and repository pattern. I structured the solution in 4 projects:
- POCO entities
- Domain model
- Services
- web application
When the application performs a query on the database, use one of the services provided, the service uses the repository and the small classes, as a result I have some dynamic proxy objects that I would like to convert in my domain entities, before using them in mvc views, but I do not know how. Dovrebber be set as the translator?
This approach is reasonable?
AutoMapper is handy for converting objects from one type to another. It will generally “do the right thing” if all your destination type properties have correspondingly named source type properties, and any nonmatching properties can easily be mapped manually using lambda expressions.