public class EnumUtils
{
public static string GetKey<T>(int value)
{
string key = string.Empty;
bool isDefined = Enum.IsDefined(typeof(T), value);
if (isDefined)
key = "Enum." + typeof(T).Name + "." + Enum.Parse(typeof(T), value.ToString()).ToString();
else
key = "Enum." + typeof(T).Name + "." + "None";
return key;
}
}
{
public static string GetKey<T>(int value)
{
string key = string.Empty;
bool isDefined = Enum.IsDefined(typeof(T), value);
if (isDefined)
key = "Enum." + typeof(T).Name + "." + Enum.Parse(typeof(T), value.ToString()).ToString();
else
key = "Enum." + typeof(T).Name + "." + "None";
return key;
}
}