Exemple #1
0
        public static Route MapRoute(this RouteCollection routes, string name, string url, string routeValueNames, object defaults)
        {
            if (routes == null)
            {
                throw new ArgumentNullException("routes");
            }
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }

            Route item = new RouteWithExclusions(url, new MvcRouteHandler(), routeValueNames)
            {
                Defaults = new RouteValueDictionary(defaults),
                DataTokens = new RouteValueDictionary()
            };
            routes.Add(name, item);
            return item;
        }
Exemple #2
0
        public static Route MapRoute(this RouteCollection routes, string name, string url, string routeValueNames, object defaults)
        {
            if (routes == null)
            {
                throw new ArgumentNullException("routes");
            }
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }

            Route item = new RouteWithExclusions(url, new MvcRouteHandler(), routeValueNames)
            {
                Defaults   = new RouteValueDictionary(defaults),
                DataTokens = new RouteValueDictionary()
            };

            routes.Add(name, item);
            return(item);
        }