private Route CreateUrlRoute(RouteCollection routes, string name, string url, object defaults, object constraints, string[] namespaces) { if (routes == null) throw new ArgumentNullException("routes"); if (url == null) throw new ArgumentNullException("url"); var route = new ServiceRoute(url, (IRouteHandler)new MvcRouteHandler()) { Defaults = CreateRouteValueDictionary(defaults),//RouteCollectionExtensions.CreateRouteValueDictionaryUncached(defaults), Constraints = CreateRouteValueDictionary(constraints),//RouteCollectionExtensions.CreateRouteValueDictionaryUncached(constraints), DataTokens = new RouteValueDictionary() }; if (namespaces != null && namespaces.Length > 0) route.DataTokens["Namespaces"] = (object)namespaces; Validate(route); routes.Add(name, (RouteBase)route); return route; }