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

Closed Issue: [AttributeRouting]Generated route name suffixes should be in the same order as the order of routes. [961]

$
0
0
In the case where action names are the same for multiple actions, to keep route names unique in the route collection, we dynamically generate the names with suffixes like Products.Get1, Products.Get2 etc.

These route suffixes should honor the order of the routes in the route collection and generate the appropriate suffixes:

Example:
```
[RoutePrefix("api/values")]
public class ValuesController : ApiController
{
// GET api/values
[HttpGet(RouteOrder = 2)]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}

// GET api/values/5
[HttpGet("{id}", RouteOrder = 1)]
public string Get(int id)
{
return "value";
}
}
```
__Actual__:
Following are the routes in the route collection __in order__:
1.
routeName: Values.Get2
routeTemplate: api/values/{id}
controller: Values
action: Get

2.
routeName: Values.Get1
routeTemplate: api/values
controller: Values
action: Get

__Expected__:
1.
routeName: Values.Get1
routeTemplate: api/values/{id}
controller: Values
action: Get

2.
routeName: Values.Get2
routeTemplate: api/values
controller: Values
action: Get
Comments: As the comment from HongMei says, if the user cares he can do that already.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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