How can I get the enum value if I have the enum string or enum int value. eg: If i have an enum as follows:
public enum TestEnum { Value1 = 1, Value
Try something like this
public static TestEnum GetMyEnum(this string title) { EnumBookType st; Enum.TryParse(title, out st); return st; }
So you can do
TestEnum en = "Value1".GetMyEnum();