I have an enum in C#:
public enum StatusEnum
{
[Display(Name = "It's Active")]
Active = 1,
Deleted = 2
}
I want to convert string to this enum, so I can use this code:
var x = Enum.TryParse("Active", out StatusEnum se);
this return true, and it's ok, but my problem is when I tried to convert the display name string:
var x = Enum.TryParse("It's Active", out StatusEnum se);
this does not work for me, what can I do?