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
Post a Comment