Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 13, 2012 07:25 AM by XIII
Dec 12, 2012 06:05 PM|LINK
Hi all i am new to project architecture so what i want to know is in mvc with EF i am planing to split the layers as
1) mvc web application
2) viewmodel project
3) bussiness layaer
4) Data Access layer
my question is in which project i will add my Ef class or else i need to create a separate project for the EF.
Dec 12, 2012 07:54 PM|LINK
viewmodels go in the presentation layer (MVC). We usually put them in a subfolder called ViewModels.
EF + mapping (in case of Code First) goes in the data access layer. The Models we pass through all the layers are put in a Common.Model class library. They're getting mapped to viewmodels in the presentation layer (not in the controller actions themselves).
Dec 12, 2012 09:35 PM|LINK
Hi thanks but still i am not clear about how to approch in this case.
Can u please reorder my solution in correct way.once again thanks for your replay
Dec 13, 2012 07:25 AM|LINK
I've also seen other architectures where between every layer there's a separate model layer and conversion steps. Consisting of 50+ projects in the solution. Most of the time that's just overkill and the above goes pretty well for small to middle class (enterprise)
applications. If you go for a super large application with lots of integrations (different layer/class library) you might want to tweak/stretch the architecture.
Simply find what works well for you, don't overdo it and be consistent.