Using the AttributeRouting library , I was able to configure attribute routing to using a special route handler (inheriting MvcRouteHandler):
routes.MapAttributeRoutes(cfg =>
{
cfg.UseRouteHandler(() => new MultiCultureMvcRouteHandler());
}
);
In addition, before MVC5, you could change the route handler of any existing route:
(routes["myroute"] as Route).RouteHandler = new MyCustomRouteHandler();
With MVC5, using attribute routing, the route collection contains inner classes (e.g. t23>), and it seems not possible to change the route property RouteHandler.
How to change the default route handler used when working with attribute routing in MVC5.1?
source
share