diff --git a/src/SmartEnum/SmartEnum.cs b/src/SmartEnum/SmartEnum.cs index 00b424d5..e6d07770 100644 --- a/src/SmartEnum/SmartEnum.cs +++ b/src/SmartEnum/SmartEnum.cs @@ -45,8 +45,8 @@ public abstract class SmartEnum : where TEnum : SmartEnum where TValue : IEquatable, IComparable { - static readonly Lazy _enumOptions = - new Lazy(GetAllOptions, LazyThreadSafetyMode.ExecutionAndPublication); + static readonly Lazy> _enumOptions = + new Lazy>(GetAllOptions, LazyThreadSafetyMode.ExecutionAndPublication); static readonly Lazy> _fromName = new Lazy>(() => _enumOptions.Value.ToDictionary(item => item.Name)); @@ -67,7 +67,7 @@ public abstract class SmartEnum : return dictionary; }); - private static TEnum[] GetAllOptions() + private static List GetAllOptions() { Type baseType = typeof(TEnum); return Assembly.GetAssembly(baseType) @@ -75,7 +75,7 @@ private static TEnum[] GetAllOptions() .Where(t => baseType.IsAssignableFrom(t)) .SelectMany(t => t.GetFieldsOfType()) .OrderBy(t => t.Name) - .ToArray(); + .ToList(); } private static IEqualityComparer GetValueComparer()