Where to call RouteDebugger.RewriteRoutesForTesting () when route registration is introduced?

As Phil Haack explains in his blog post, the route debugger helps visualize your routing tables.
My site, however, gets its routing injected with MVCTurbine dependency injection (using Unity) as follows:

public class DefaultRoutRegistration : IRouteRegistrator
{
    public void Register(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "Accounts",
            "Accounts/{userName}/{action}",
            new { controller = "Account", action = "Index" }
            );

        routes.MapRoute(
            "Default",                                              // Route name
            "{controller}/{action}/{id}",                           // URL with parameters
            new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
            );
        RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
    }
}

Where exactly can I throw in RouteDebug.RouteDebugger.RewriteRoutesForTesting (RouteTable.Routes); rewrite my routing table?

+3
source share
1 answer

Sorry Boris, but I do not notify you when asked about StackOverflow for turbine tag. :(

, RouteDebug.

0

Source: https://habr.com/ru/post/1739780/


All Articles