Possible Duplicate:
Get Enum from Description attribute
Hi All, I have and Enum defined like this.
public enum SomeType {
[Description("One Value")]
One,
[Description("Two Value")]
Two,
[Description("Three Value")]
Three
}
but when I try to parse a string like this
SomeType test = (SomeType )Enum.Parse(typeof(SomeType ), "Three Value");
I get excetion "Requested value 'Three Value' was not found". Isn't this supposed to work ?
Thanks