Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: Add support to attribute routing for ignoring the route prefix [1150]

$
0
0
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() { /* ... */ }
}
```


Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>