public static string GetDisplayName([NotNull] this Enum value) { var descriptions = value.GetAttributeValues <DisplayNameAttribute, string>(a => a.DisplayName); return(descriptions.Length > 0 ? string.Join(Environment.NewLine, descriptions) : string.Empty); }
public static IEnumerable <string> GetDisplayNames([NotNull] this Enum value) => value.GetAttributeValues <DisplayNameAttribute, string>(a => a.DisplayName);
public static IEnumerable <string> GetDescriptions([NotNull] this Enum value) => value.GetAttributeValues <DescriptionAttribute, string>(a => a.Description);