I need to iterate over the the Http route table from the ASP.NET Web API from within an ASP.NET MVC Controller action method in the same project. All the routes work fine. I've been playing around with the HttpRouteCollection
but its always empty.
I've been trying things like this: -
var httpRoutes = new IHttpRoute[10];
new HttpRouteCollection().CopyTo(httpRoutes, 0);
foreach (var route in httpRoutes)
{
// ...
}
Or this : -
var httpRoutes = new IHttpRoute[10];
new HttpRouteCollection("api/").CopyTo(httpRoutes, 0);
foreach (var route in httpRoutes)
{
// ...
}
How do I get to this info?