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

Commented Issue: Disambiguate actions correctly when they are overloaded by Enum types [312]

$
0
0
The details behind this issue can be found here:
http://forums.asp.net/post/5102466.aspx

Enum types by default are FromUri as it has a TypeConverter from string.
Comments: Just ran into this as well. If you take the default WebAPI project template and replace the optional int id parameter on the get methods: ... // GET api/values public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } //// GET api/values/5 public string GetBaz(SomeEnum id) { return "value"; } ... Then WebAPI will no longer be able to disambiguate between these 2 methods and throw an exception saying there are 2 action methods matching the request.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



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