possible duplicate of Finding an enum value by its Description Attribute
I get the description of the MyEnum from the user selected checkbox, I have to find the value and save it. Can someone help me how to find the value of the Enum given description
public enum MyEnum
{
[Description("First One")]
N1,
[Description("Here is another")]
N2,
[Description("Last one")]
N3
}
For example i will be give Here is Another i have to return N1, when I receive Last one I have to return N3.
I just have to do the opposite of How to get C# Enum description from value?
Can someone help me?