示例#1
0
        private Route TryMatch(Template template, RouteDataExtractor extractor)
        {
            Dictionary <String, String> routeData = extractor.Extract(template.Tokens);
            Route result = RouteResolver.Resolve(_controllers, routeData);

            return(result);
        }
示例#2
0
        public Route Get(string[] args)
        {
            Route result = null;
            RouteDataExtractor extractor = new RouteDataExtractor(args);

            foreach (var template in _templates)
            {
                result = TryMatch(template, extractor);
                if (null != result)
                {
                    break;
                }
            }

            return(result ?? new Route(typeof(ErrorController), typeof(ErrorController).GetMethod("ShowNotFoundError")));
        }