I’m working on a controller that is a part of a very flat hierarchy of pages, and it looks like one section of the site could have over a dozen action methods, not including their corresponding post actions. Is there a good way to break this controller up while still preserving the section name? I don’t want that controller class getting out of control.
Share
If your controller class is getting out of control on a dozen actions, you might want to rethink how much logic should be in there and how much can be refactored out into services.
Also, if your controller is getting up to much more than a dozen actions, you might want to consider whether it can be broken down into separate controllers. Remember, you can change the routing rules and controller factory such that the URL remains the same but the controller is broken up.
If you’re comfortable that you’ve done what you can and still want to break it into separate files – use a partial class.