Am migrating a WebApi project (from preview version aka WCF WebApi to final release aka ASP.NET MVC4 WebApi).
In WCF WebApi, URI templates were defined for all services operations, like:
[WebGet(UriTemplate = "{movieGenreId}/movies")]
Bare I mind I have tens of those in the project. How do I translate this to MVC4 WebApi without having to register tens of entries in the Route table?
You could go with the excellent attribute routing for Web API project:
Here is the source on GitHub (both MVC & Web API) - https://github.com/mccalltd/AttributeRouting
Here is a short intro to attribute routing in Web API - http://www.strathweb.com/2012/05/attribute-based-routing-in-asp-net-web-api/
Here is the Nuget for the attribute routing Web API package - http://nuget.org/packages/AttributeRouting.WebApi/3.1.2
It should be almost as easy as search and replace to convert UriTemplates to Attribute Routing.
If you are not willing to include the attribute routing library in your project, unfortunately the only other way is - as you said - registering tens of routes.