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

Edited Unassigned: [AttributeRouting]Route not being added to route collection [1005]

$
0
0
In the following scenario, the Get() action on ReproController, which is decorated with an attribute route is _not_ being added to the route collection.

On the other hand, the Get() action on the WorkingConroller is added to the route collection as expected.

Expected: Get() action on ReproController should be part of route collection
Actual: Not added to route collection.

```
public class ReproController : ApiController
{
//NOTE: NOT added to route collection
[HttpGet(RouteName="GetAllValues")]
public string Get()
{
return "Repro.GetAllValues";
}
}

public class WorkingController : ApiController
{
//NOTE: ADDED to route collection. Notice the empty route template
[HttpGet("", RouteName = "GetAllValues2")]
public string Get()
{
return "Working.GetAllValues2";
}
}
```

Viewing all articles
Browse latest Browse all 7215

Trending Articles