Enhance the routing API
While I was working on WebAPIContrib I found several issues with the Routing API. I described it in more detail here: http://pedroreys.com/2012/03/14/asp-net-web-api-routing-needs-a-hug/
1 comment
-
Looking at your blog post I believe you highlight four issues:
1. Why do you need to specify a route name to generate a link when the MVC UrlHelper.Action(…) method don’t require you to specify one?
- Looks like the behavior of MVC is to iterate over the routes and pick the first one that happens to work. Is this the desired behavior?
2. Cannot foreach loop over HttpRouteCollection
- Fixed!
3. No way to get the name of a route from the route or the route collection
- This is really an issue with ASP.NET Routing, although it is aggravated by Web API requiring the route name to generate links.
4. Creating a Web API UrlHelper should only require the request, not the controller context
- Fixed! You can create a UrlHelper with just the request.