public static string GetEnumMemberStringValue(this System.Enum enumVal) => enumVal.GetAttributeOfType <EnumMemberAttribute>()?.Value;
Ejemplo n.º 2
0
 /// <summary>
 /// GetDescription
 /// </summary>
 public static string GetDescription(this Enum value) =>
 value.GetAttributeOfType <DescriptionAttribute>()?.Description ?? string.Empty;
Ejemplo n.º 3
0
 public static string GetDescription(this Enum enumVal, string defaultValue = null)
 {
     return(enumVal.GetAttributeOfType <DescriptionAttribute>()?.Description ?? defaultValue);
 }