Esempio n. 1
0
 public DomainRoute(SitkaRouteTableEntry sitkaRouteTableEntry, string[] namespaces)
     : base(
         sitkaRouteTableEntry.RouteUrl,
         new RouteValueDictionary(new { controller = sitkaRouteTableEntry.Controller, action = sitkaRouteTableEntry.Action, sitkaRouteTableEntry.Area }),
         null,
         new RouteValueDictionary(
             new { Namespaces = namespaces, sitkaRouteTableEntry.Area, UseNamespaceFallback = false, Domain = sitkaRouteTableEntry.AreaAsSubdomainName, sitkaRouteTableEntry.IsCrossAreaRoute }),
         new MvcRouteHandler())
 {
     SitkaRouteTableEntry = sitkaRouteTableEntry;
     Domain       = sitkaRouteTableEntry.AreaAsSubdomainName;
     _domainRegex = DomainRegexCache.CreateDomainRegex(Domain);
 }
Esempio n. 2
0
        public static void AddToRouteTable(SitkaRouteTableEntry routeEntry)
        {
            var namespaces = new string[] {};

            if (!String.IsNullOrEmpty(routeEntry.Namespace))
            {
                namespaces = new[] { routeEntry.Namespace };
            }
            if (!String.IsNullOrEmpty(routeEntry.AreaAsSubdomainName))
            {
                var route = new DomainRoute(routeEntry, namespaces);
                _routes.Add(route);
            }
            else
            {
                _routes.MapRoute(routeEntry.RouteName, routeEntry.RouteUrl, new { controller = routeEntry.Controller, action = routeEntry.Action }, routeEntry, namespaces);
            }
        }
Esempio n. 3
0
        private static SitkaRouteTableEntry CreateSitkaTableRouteEntry(MethodInfo controllerActionMethod, string action, string controller, string area, string areaAsSubdomainName, string routeUrl, string routeName, int?routeOrder, bool isCrossAreaRoute)
        {
            var routeEntry = new SitkaRouteTableEntry(routeName, routeUrl, controllerActionMethod.ReflectedType.Namespace, controller, action, area, areaAsSubdomainName, routeOrder, isCrossAreaRoute);

            return(routeEntry);
        }