Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Integers from JSON don't bind to enums #2609

Closed
Tragetaschen opened this issue May 26, 2015 · 2 comments
Closed

Integers from JSON don't bind to enums #2609

Tragetaschen opened this issue May 26, 2015 · 2 comments

Comments

@Tragetaschen
Copy link
Contributor

I have the following setup:

  • A Razor <select> populated by GetEnumSelectList, so the options's values are numbers
  • Some client code that creates JSON from the currently selected entry
  • A controller, that parses the JSON (now the values are Int64!)
  • Model binding trying to fill an enum field

This setup fails, because enum binding is only supported for Int32.

I didn't check, but a failing test looks much like this ValueProviderResult test with the 1 replaced by 1L.

@danroth27 danroth27 added this to the 6.0.0-beta6 milestone May 26, 2015
@danroth27
Copy link
Member

@Tragetaschen Thanks for reporting this issue! Do you have a simple project you could send us that reproduces this issue so that we can investigate?

@Eilon
Copy link
Member

Eilon commented Jun 5, 2015

We should ideally support value provider results containing all kinds of numeric treasures.

@ajaybhargavb , you can sync with @dougbu on the background for this bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants