Does the entity model replace the model in mvc
Please forgive me i开发者_开发百科f this is a stupid question but if I use the entity framework do I not need to create model classes manually? Does the entity model replace the need for the model?
Suggestions welcome to a complete newbie knob :)
I have up-voted this question because people ask me this a lot and I think there is an important interpretation of this design pattern to consider.
The model in MVC has a single purpose - to act as a bag of properties that must be passed between the controller and the view.
If you were to use an entity, instead of a specific model, would that entity contain everything you need? In most cases, the answer is no. You don't want to add a property to your entity to support something on a UI, so you should have a model that is specifically designed for that purpose.
I have often seen an entity as a property on the model though, which I don't have any problem with.
精彩评论