Esempio n. 1
0
        public void Configure(RoutingEngineBuilder <TContext> builder)
        {
            // this should build the route based on the path and configured route options
            var route = new RouteImpl(_path, Enumerable.Empty <RouteParameter>(),
                                      Enumerable.Empty <RouteVariable>());

            RouteBuilder <TContext> routeBuilder = _builderFactory(route);

            // again, need to run configurators against the route for defaults, constraints, etc.
            // depending upon the builder, many of these may be handled via types and default arguments

            // not sure, but I think I want the navigation of the routes to be common
            builder.AddRouteBuilder(routeBuilder);
        }
Esempio n. 2
0
		public virtual Route New(UrlPattern pattern)
		{
			try
			{
				IEnumerable<RouteParameter> parameters = _parser.Parse(pattern);

				var routeDefinition = new RouteImpl(pattern, parameters, Enumerable.Empty<RouteVariable>());

				return routeDefinition;
			}
			catch (Exception ex)
			{
				throw new RoutingException("The route could not be created", ex);
			}
		}
Esempio n. 3
0
        public virtual Route New(UrlPattern pattern)
        {
            try
            {
                IEnumerable <RouteParameter> parameters = _parser.Parse(pattern);

                var routeDefinition = new RouteImpl(pattern, parameters, Enumerable.Empty <RouteVariable>());

                return(routeDefinition);
            }
            catch (Exception ex)
            {
                throw new RoutingException("The route could not be created", ex);
            }
        }