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

Edited Issue: [AttributeRouting]Handle scenario when multiple route prefixes are used and there are explicit RouteNames on actions [959]

$
0
0
Currently the following would cause a problem, as we try to create 2 routes(one for each route prefix) with the same route name calle "GetSingleSample".

```
[RoutePrefix("api/test")]
[RoutePrefix("api/samples/test")]
public class SampleController : ApiController
{
[HttpGet("{id}", RouteName="GetSingleSample")]
public string Get(int id)
{
return "Get" + id;
}
}
```

__Error__:
A route named 'GetSingleSample' is already in the route collection. Route names must be unique.
Parameter name: name

__NOTE__:
1. This issue existing for MVC Attribute Routing too. We need to fix it there too.
2. Also while fixing this bug, we need to think of how can one generate Uri links based on particular route-prefixes too.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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