Controller without controller suffix

as per my design requirements, I would like to remove the "Controller" suffix from my controllers and replace it with "Resource". So "FundsController" will become "FundsResource".

The problem is that I am unable to route my specified actions using negotiation or attribute based routing when I change the replacement for the term "Controller" and get an error stating that a controller with that name cannot be found.

How can I meet the above design requirement and also be able to route seamlessly? Either in convention based routing or attribute? Or if we can combine the benefits of convention-based and attribute routing to achieve this?

Thanks in advance.

+2


source to share


1 answer


The "controller" is hardcoded into the framework, but you can create a new controller like a controller. Here's a great article from Philip - http://www.strathweb.com/2013/02/but-i-dont-want-to-call-web-api-controllers-controller/ .



+4


source







All Articles