I want to separate my controller logic for each view in a directory rather than have all of it in one controller because I don’t want that many actions in one. Any way to achieve this?
Views--
FooFolder
Fooview.cshtml
Barview.cshtml
Controllers--
FooController.cs
BarController.cs
There is no requirement to have views in a certain folder or actions in a certain controller. It’s just a convention, and you can change it, either by, e.g., replacing the view engine or changing route definitions or by explicitly specifying view paths. However, if you want to separate controller logic the place to start isn’t with the controller itself, but by offloading the logic into business methods elsewhere and calling that from the controller.