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

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

Comments: Checked in: https://aspnetwebstack.codeplex.com/SourceControl/changeset/962c265473d77ec62dab3361886ca96178a8b886 https://aspnetwebstack.codeplex.com/SourceControl/changeset/5aedf25113a8c28af9e43ba9cd1247fd25ecabda

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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