using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; public static class EnumHelper { public static List<(T Value, string Description)> GetEnumValuesAndDescriptions() where T : Enum { return typeof(T).GetFields() .Select(field => ( Value: (T)field.GetValue(null), Description: field.GetCustomAttribute()?.Description ?? field.Name )) .ToList(); } }