// Add generation hooks for the Attribute-routing subroutes. // This lets us generate urls for routes supplied by attr-based routing. private static void AddGenerationHooksForSubRoutes(HttpRouteCollection destRoutes, HttpRouteCollection sourceRoutes) { foreach (KeyValuePair <string, IHttpRoute> kv in sourceRoutes.GetRoutesWithNames()) { string name = kv.Key; IHttpRoute route = kv.Value; var stubRoute = new GenerateRoute(route); destRoutes.Add(name, stubRoute); } }