This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Model-binding is being case-sensitive when binding Url data to Enum parameter #913
Comments
kichalla
changed the title
Model-binding is being case-sensitive when binding data from url
Model-binding is being case-sensitive when binding Url data to Enum parameter
Aug 1, 2014
Seems like a specific issue with the Enum conversion - https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.ModelBinding/ValueProviders/ValueProviderResult.cs#L241 needs to use the ignoreCase overload. |
Likely to be resolved with TypeConverter support. |
sornaks
pushed a commit
that referenced
this issue
Oct 12, 2014
…ata to Enum parameter. Fix: Using TypeConverter solves this problem. Issue #1123 - TypeConverterModelBinder cannot bind "byte" and "short". Fix: Modified code to use TypeConverter which can handle these scenarios.
sornaks
pushed a commit
that referenced
this issue
Oct 14, 2014
…ata to Enum parameter. Fix: Using TypeConverter solves this problem. Issue #1123 - TypeConverterModelBinder cannot bind "byte" and "short". Fix: Modified code to use TypeConverter which can handle these scenarios.
sornaks
pushed a commit
that referenced
this issue
Oct 14, 2014
…data to Enum parameter. Fix: Using TypeConverter solves this problem. -Issue #1123 - TypeConverterModelBinder cannot bind "byte" and "short". Fix: Modified code to use TypeConverter which can handle these scenarios. -Removing the GetConverterDelegate method and making the code similar to the WebApi.
Checked in - 5fa8a91 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For the following action, sending a request like this fails model validation:
Succeeds:
products/search?categories=Books&searchterm=adidas
Fails((note the case of
books
):products/search?categories=books&searchterm=adidas
Action:
Enum:
Error:
The text was updated successfully, but these errors were encountered: