0

For the reasons that are not important to the question, I would like to know how to make my controllers / routing work in ASP.NET MVC5 if my controller class names do not end in Controller as per convention? Do I need to manually register them somewhere?

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Fit Dev
  • 3,413
  • 3
  • 30
  • 54

1 Answers1

4

The Controller suffix is baked into the the ControllerDescriptor and ControllerTypeCache classes making it hard to override. One way that comes to mind is to write a custom controller factory and override the GetControllerType method.

Nkosi
  • 235,767
  • 35
  • 427
  • 472
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928