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

Edited Issue: [AttributeRouting]Action having multiple attributes should have appropriate method constraints for corresponding route template [969]

$
0
0

For the following action:
```
[HttpPost("api/values/path1")]
[HttpGet("api/values/path2")]
public void DoSomething()
{
}

```

Currently the routes in the collection are like following:

RouteTemplate:
'api/values/path1' (note: __path1__)
Defaults:
Key:controller, Value:Values
Key:action, Value:DoSomething
Constraints:
Key:httpMethod, Value: __POST, GET__


RouteTemplate:
'api/values/path2' (note: __path2__)
Defaults:
Key:controller, Value:Values
Key:action, Value:DoSomething
Constraints:
Key:httpMethod, Value: __POST, GET__


While fixing this issue, also look into the following scenario:

For the following action:
```
[HttpGet("api/values/path1")]
[HttpGet("api/values/path2")]
public void DoSomething()
{
}
```

Currently following is the route information:

RouteTemplate: 'api/values/path1'
Defaults:
Key:controller, Value:Values
Key:action, Value:DoSomething
Constraints:
Key:httpMethod, Value: __GET, GET__

RouteTemplate: 'api/values/path2'
Defaults:
Key:controller, Value:Values
Key:action, Value:DoSomething
Constraints:
Key:httpMethod, Value: __GET, GET__

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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