It allows to apply multiple route prefixes using attributes in MVC5 like:
[RouteMPrefix("v1/values")]
[RouteMPrefix("v2/values")]
public class ValuesController : ApiController
{
[Route("list")]
[Route("get")]
public IEnumerable<string> Get()
{
return new[] { "value1", "value2" };
}
}- Add
MultiPrefixRouteProvider.csandRouteMPrefixAttribute.csto your project - Use
MultiPrefixRouteProviderwhen initializing attribute routing:
config.MapHttpAttributeRoutes (new MultiPrefixRouteProvider());Detailed description is here.