Get Enum Value from String
var em = (ChooseEnum) Enum.Parse( typeof(ChooseEnum), desc);
Get DescriptionAttribute from Enum Value
public static string ConvertToSql(Enum value)
{
Type enumType = value.GetType();
string name = Enum.GetName(enumType, value);
if (name != null)
{
FieldInfo fieldInfo = enumType.GetField(name);
if (fieldInfo != null)
{
DescriptionAttribute attribute = Attribute.GetCustomAttribute(fieldInfo, typeof(DescriptionAttribute), false) as DescriptionAttribute;
if (attribute != null)
{
return attribute.Description;
}
}
}
return null;
}
Reference Links: C# Get and Parse DescriptionAttribute of Enum Type How to get the value corresponding to Enum object from string in C#