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

Flags enum does not bind #220

Closed
pranavkm opened this issue Apr 9, 2014 · 6 comments
Closed

Flags enum does not bind #220

pranavkm opened this issue Apr 9, 2014 · 6 comments

Comments

@pranavkm
Copy link
Contributor

pranavkm commented Apr 9, 2014

From the thread at #214 (comment),

In Mvc, for the enum type,

        [Flags]
        private enum MyFlagsEnum
        {
            Value0 = 1,
            Value1 = 2,
            Value2 = 4
        }
  • the value 5 will get correctly bound as MyFlagsEnum.Value0 | MyFlagsEnum.Value2. This does not happen in our code.
  • The string "Value0" will bind to MyFlagsEnum, but we dont have anything equivalent for flags that is "Value0 | Value1" will not bind.
@yishaigalatzer
Copy link
Contributor

@pranavkm where does this stand?

@danroth27
Copy link
Member

Likely to be resolved by support for TypeConverters

@danroth27
Copy link
Member

@kulmugdha Could please verify if this issue is fixed? Thanks!

@danroth27 danroth27 added this to the 6.0.0-beta1 milestone Oct 15, 2014
@kulmugdha
Copy link
Contributor

No this doesn't seem to be fixed. Talked to @pranavkm , he confirmed that we haven't fixed it.

@danroth27 danroth27 assigned sornaks and unassigned kulmugdha Oct 17, 2014
sornaks pushed a commit that referenced this issue Oct 20, 2014
Fix - After TypeConverter support this works. Adding tests for the same.
@danroth27 danroth27 modified the milestones: 6.0.0-beta2, 6.0.0-beta1 Oct 20, 2014
sornaks pushed a commit that referenced this issue Oct 22, 2014
Fix - After TypeConverter support this works. Adding tests for the same.
@sornaks
Copy link

sornaks commented Oct 22, 2014

The string "Value0" will bind to MyFlagsEnum, but we dont have anything equivalent for flags that is "Value0 | Value1" will not bind.

The ToString() equivalent of "Value0 | Value1" is "Value0, Value1" - which binds properly. I have added test cases for the same - #1413

sornaks pushed a commit that referenced this issue Oct 22, 2014
Fix - After TypeConverter support this works. Adding tests for the same.
@sornaks
Copy link

sornaks commented Oct 22, 2014

Chedked in - 1dd1652

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

6 participants