Beispiel #1
0
        /// <summary>
        /// Gets useful information from the specified template route
        /// </summary>
        /// <param name="route">Template route to get information from</param>
        /// <returns>Information from the route</returns>
        private RouteInfo ProcessTemplateRoute(Route route)
        {
            var info = new RouteInfo
            {
                Constraints = _constraintsProcessor.ProcessConstraints(route.Constraints),
                Defaults    = route.Defaults.ToDictionary(x => x.Key.ToLowerInvariant(), x => x.Value),
                Optional    = new List <string>(),
            };
            var template = TemplateParser.Parse(route.RouteTemplate);

            _parser.Parse(template, info);

            return(info);
        }