converting MVC EF to 3-Tiers Architecture model

一世执手 提交于 2019-12-13 07:33:03

问题


I was working on my project using MVC3 & Entity framework and the model of my project was about my entity.emdx only. now i want to convert this project to 3-tiers architecture that will be about: (presentation layer :my old MVC project's views and controllers), (business layer:all operations related to data base), (data access layer: my entity framework(.emdx)), This is what i concluded,, and if i am correct then the model in the MVC project (presentation layer) will be empty ,,,is it possible in MVC that doesn't contain Models?, if my thinking is wrong so, what is the correct thing to do?


回答1:


Yeah its possible to don't have model, the data access layer you created is now act as the Model found in presentation layer(when it was 1 tier)..

The Models now are the entities in the data access, but you Make can your Model even in 3 tier application for some reason like if you want to create ViewModel, see this example about it:

http://www.edandersen.com/2013/05/30/asp-net-mvc-basics-part-2-viewmodel-to-model-mapping-and-editing/



来源:https://stackoverflow.com/questions/33321967/converting-mvc-ef-to-3-tiers-architecture-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!