using System; using System.Reflection; using BriarQueen.Data.Attributes; namespace BriarQueen.Framework.Extensions { public static class EnumExtensions { public static string GetDisplayName(this Enum value) { var type = value.GetType(); var field = type.GetField(value.ToString()); if (field == null) return value.ToString(); var attribute = field.GetCustomAttribute(); return attribute != null ? attribute.Name : value.ToString(); } } }