示例#1
0
        public void Publish(IEnumerable <RouteDescriptor> routes)
        {
            foreach (var route in routes)
            {
                IRouter router = new TemplateRoute(
                    _routeBuilder.DefaultHandler,
                    route.Route.RouteName,
                    route.Route.RouteTemplate,
                    route.Route.Defaults,
                    route.Route.Constraints,
                    route.Route.DataTokens,
                    _routeBuilder.ServiceProvider.GetService <IInlineConstraintResolver>());

                _routeBuilder.AddTenantRoute(_shellSettings.RequestUrlPrefix, router);
            }
        }
示例#2
0
        public void Publish(IEnumerable <RouteDescriptor> routes, RequestDelegate pipeline)
        {
            var routesArray = routes
                              .OrderByDescending(r => r.Priority)
                              .ToArray();

            foreach (var route in routesArray)
            {
                IRouter router = new TemplateRoute(
                    _routeBuilder.DefaultHandler,
                    route.Route.RouteName,
                    route.Route.RouteTemplate,
                    route.Route.Defaults,
                    route.Route.Constraints,
                    route.Route.DataTokens,
                    _routeBuilder.ServiceProvider.GetService <IInlineConstraintResolver>());

                _routeBuilder.AddTenantRoute(_shellSettings.RequestUrlPrefix, router, pipeline);
            }
        }