I have a simple enum:
public enum MyEnum
{
[Description("Zero")]
Zero,
[Description("A positive number")]
Positive,
[Description("Any integer")]
AnyInteger,
[Description("A negative number")]
Negative,
[Description("Reserved number")]
Reserved =2
}
However, running the the following code:
MyEnum temp = MyEnum.AnyInteger;
string en = temp.ToString();
sets the en string to Reserved.
Why does it happens?
Is there is some other way to set the string to the used enum string (in this case AnyInteger)?