Reputation: 701
I'm kind of new to ASP.Net MVC 4. I'm working on an app that will have a lot of routes. With that in mind, I'm running into naming conflicts in my Controller. Because of this, I've decided that I want to split up my Controller into multiple controllers. In an attempt to keep things clean, I feel I have a need to put Controller classes in subdirectories within the Controllers directory. My questions are:
Thank you!
Upvotes: 7
Views: 6076
Reputation: 301527
Is this an option? Definitely. You can place the controllers wherever you want. MVC would automatically scan the assembly for controllers and it doesn't matter if they are placed only under Controllers
.
If things get more complex, and you want better organization, you can leverage the concept of Areas
in ASP.NET MVC - http://msdn.microsoft.com/en-us/library/ee671793(v=vs.100).aspx
Upvotes: 8