public static TranslatedRoute MapTranslatedRoute(this RouteCollection routes, string name, string url, object defaults, object routeValueTranslationProviders, bool setDetectedCulture) { TranslatedRoute route = new TranslatedRoute( url, new RouteValueDictionary(defaults), new RouteValueDictionary(routeValueTranslationProviders), setDetectedCulture, new MvcRouteHandler()); routes.Add(name, route); return(route); }
public static TranslatedRoute MapTranslatedRoute(this RouteCollection routes, string name, string url, object defaults, object routeValueTranslationProviders, bool setDetectedCulture) { TranslatedRoute route = new TranslatedRoute( url, new RouteValueDictionary(defaults), new RouteValueDictionary(routeValueTranslationProviders), setDetectedCulture, new MvcRouteHandler()); routes.Add(name, route); return route; }
public static Route MapTranslatedRoute(this AreaRegistrationContext areaContext, string name, string url, object defaults, object routeValueTranslationProviders, bool setDetectedCulture) { Route route = new TranslatedRoute( url, new RouteValueDictionary(defaults), new RouteValueDictionary(routeValueTranslationProviders), setDetectedCulture, new MvcRouteHandler()); if (route.DataTokens == null) route.DataTokens = new RouteValueDictionary(); route.DataTokens["area"] = areaContext.AreaName; // disabling the namespace lookup fallback mechanism keeps this areas from accidentally picking up // controllers belonging to other areas bool useNamespaceFallback = (areaContext.Namespaces == null || areaContext.Namespaces.Count == 0); // route.DataTokens["UseNamespaceFallback"] = useNamespaceFallback; areaContext.Routes.Add(route); return route; }