1

Closed

Add support to attribute routing for ignoring the route prefix

description

AttributeRouting.net has an option for ignoring the route prefix:
[RoutePrefix("Prefix")]
public class IgnorePrefixController : Controller
{
    [GET("Index")] // => "Prefix/Index"
    [GET("NoPrefix", IgnoreRotuePrefix = true)] // => "NoPrefix"
    public ActionResult Index() { /* ... */ }
}
It's really convenient to be able to add a route for an action without having to worry about existing route prefixes. This is like having absolute and relative URI paths.

Maybe we could use a leading slash as a way to indicate an absolute route path?:
[RoutePrefix("Prefix")]
public class IgnorePrefixController : Controller
{
    [GET("Index")] // => "Prefix/Index"
    [GET("/NoPrefix")] // => "NoPrefix"
    public ActionResult Index() { /* ... */ }
}
Closed Aug 2, 2013 at 12:16 AM by kichalla
Verified.