c# - What is the relationship between domain models and view models? Do they need to be separate? (Does using EF complicate this?) -


so programming background self-taught , sporadic. working on mvc4 project , trying focus on best practices rather functionality.

the general sense of project report generator. trying understand domain model vs view model are, , how related models used codefirst entity framework. tips appreciated.

from understanding, let's report object has multiple properties, view want user able edit properties, viewmodel maps between report object , user input?

sounds you've got right idea. viewmodel view representation of domain entity. can applied both data coming in , data going out of model.

but, layer (and mappings) increase complexity of code. need view model class, mapper class, , domain entity (ef). so, if can build need without layer, keep simple. domain models , domain modeling should used business domain complex.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -