Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum type isn't binding from QueryString #6

Open
derekgreer opened this issue Feb 17, 2017 · 0 comments
Open

Enum type isn't binding from QueryString #6

derekgreer opened this issue Feb 17, 2017 · 0 comments

Comments

@derekgreer
Copy link

derekgreer commented Feb 17, 2017

I've got an enum type which I've declared as a property on a model and am issuing an HTTP GET request. I found that the value being passed in wasn't binding to the model which caused the enum to be set to its default value. I decided to make the property nullable to test whether the property was being set to the default value because no value was set or because it was somehow receiving the default value and discovered that the binding started working. I then reverted the change and unregistered the HybridModelBinderApplicationModelConvention to use the default model binding and saw that value was set properly. I then tested with the hybrid model binder again, but changed the request to an HTTP POST rather than a GET and it worked properly.

So, it seems there is an issue with the hybrid model binder with Enums when the values are sent via the QueryString.

@derekgreer derekgreer changed the title Enum type isn't binding Enum type isn't binding from QueryString Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant