问题
Is it possible to override the controller name in ASP.NET MVC 4? It's needed for routing.
There is [ActionName("some-action-name")]
attribute to override the action name.
Is it possible to do the same for a controller class name?
It's needed to make a controller name in the routing to have dashes, like "some-controller-name" instead of "SomeControllerName"
回答1:
Solved with routes. It's the only way to do it.
Thanks for comments.
来源:https://stackoverflow.com/questions/15831869/asp-net-mvc-4-override-controller-name