Reputation: 199
I'm working on a pretty big project, which have insane ammount of methods in each controller. Same with Views, one folder contains about 150 .cshtml
files, what makes this hard to explore. I wanted to create separate folder for each part of window, but that changes my routing adress from ./Tavern/Shop
to /Views/Tavern/Tavern/Shop
. Tavern controller have 3000+ lines of code, and even with (Ctrl+F) its hard to find and edit some functionality.
Any ideas how can i improve this without changing many files in solution?
Upvotes: 0
Views: 284
Reputation: 4556
It is hard to help without viewing your code but these should be your guidelines:
Controllers should be as 'skinny' as possible, all the code should be done in your BL layer. (external lib)
Controller should be very specific - i.e. product, contact, home, etc...
The routing is done via the controller, and not the location of the view - you can specify on your return View("~/AnyPath/GoesHere/AndTheRouting/IsTheSame.cshtml") (it will be controller/action) (or however you defined it in the routing.config)
You can consider working with Areas.
Upvotes: 2