Skip to content

mshmelev/MultiPrefixRoute

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

MultiPrefixRoute

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" };
  }
}
  1. Add MultiPrefixRouteProvider.cs and RouteMPrefixAttribute.cs to your project
  2. Use MultiPrefixRouteProvider when initializing attribute routing:
config.MapHttpAttributeRoutes (new MultiPrefixRouteProvider());

Detailed description is here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages