hi all,
I am trying to put model and controller in different class libraries as I have to do a large scale project on MVC but I am not getting right approach to do it.
I have googled it a lot but unable to get what i want. I have tried by myself too but i got stuck when i put controller in different library. I have put reference in my application but still I am unable to run it.
so,please show the right approach to do it.
Thanks.
abhishekPosted Nov 26, 2014, 1:16 AM
Definitely you are right. MVC itself provides the functionality of n-tier or layered architecture (in the words of layman). But my concern is to hide my code for controller and models thats why I am eager to put controllers and models in different class libraries.
Thanks
Abhishek KumarPosted Nov 24, 2014, 7:39 AM
N-tier architecture is a system architecture pattern, while MVC is an application architecture pattern.
why you want to implement layered architecture in MVC as you will get a framework which is very easy to maintain itself.
abhishekPosted Nov 24, 2014, 6:28 AM
Thanks for your reply. I have go through the link you provided.It is very nice.But I want to put controller and models in separate class libraries so that I can use their dll.
I know that MVC provide separency already but i want to give it a layered architecture.Hope you will understand my problem and provide some solution.
Thanks
Abhishek KumarPosted Nov 24, 2014, 5:44 AM
Plaese try to use concept of area in your project.
Area in MVC will help you to organize models, views, and controllers into separate functional sections of the application.
Follow below areticle
http://www.dotnet-tricks.com/Tutorial/mvc/a9P1010113-MVC-Areas-with-example.html
Let me know if you find any difficulty or want some sample code.
Abhishek