Friday, September 9, 2016

You may specify a type at an MVC Web API route.

...like so: whatever/{id:int} ...but don't use string for the type. For a string just leave out the colon and the type like so whatever/{id} as not doing so will throw a cryptic error to do with DefaultConstraintResolver.

No comments:

Post a Comment