1

By default asp.net mvc looks for controller classes that end with "Controller". Can I change it so that it looks for classes that end with underscore controller, "_Controller"?

soccerazy
  • 65
  • 4
  • 1
    So this apparently a dupe! Your answer lies here :http://stackoverflow.com/questions/3011482/controller-name-convention-in-asp-net-mvc – gideon Dec 03 '11 at 08:44

2 Answers2

0

Yes, you can do this by creating your own custom ControllerFactory.

Chris Fulstow
  • 41,170
  • 10
  • 86
  • 110
  • ok so i can see that it is possible by writing my own controller factory. anybody have an example of a controller factory that gets controllers by class name convention other than the asp.net mvc default (something similar to what i'm doin). – soccerazy Dec 03 '11 at 09:31
0

gideon is right, this is a dup of this SO thread, see ControllerDescriptor & ControllerTypeCache. A better question is why do you feel the need to change it?

Community
  • 1
  • 1
RickAndMSFT
  • 20,912
  • 8
  • 60
  • 78