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