File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ public abstract class SmartEnum<TEnum, TValue> :
45
45
where TEnum : SmartEnum < TEnum , TValue >
46
46
where TValue : IEquatable < TValue > , IComparable < TValue >
47
47
{
48
- static readonly Lazy < TEnum [ ] > _enumOptions =
49
- new Lazy < TEnum [ ] > ( GetAllOptions , LazyThreadSafetyMode . ExecutionAndPublication ) ;
48
+ static readonly Lazy < List < TEnum > > _enumOptions =
49
+ new Lazy < List < TEnum > > ( GetAllOptions , LazyThreadSafetyMode . ExecutionAndPublication ) ;
50
50
51
51
static readonly Lazy < Dictionary < string , TEnum > > _fromName =
52
52
new Lazy < Dictionary < string , TEnum > > ( ( ) => _enumOptions . Value . ToDictionary ( item => item . Name ) ) ;
@@ -67,15 +67,15 @@ public abstract class SmartEnum<TEnum, TValue> :
67
67
return dictionary ;
68
68
} ) ;
69
69
70
- private static TEnum [ ] GetAllOptions ( )
70
+ private static List < TEnum > GetAllOptions ( )
71
71
{
72
72
Type baseType = typeof ( TEnum ) ;
73
73
return Assembly . GetAssembly ( baseType )
74
74
. GetTypes ( )
75
75
. Where ( t => baseType . IsAssignableFrom ( t ) )
76
76
. SelectMany ( t => t . GetFieldsOfType < TEnum > ( ) )
77
77
. OrderBy ( t => t . Name )
78
- . ToArray ( ) ;
78
+ . ToList ( ) ;
79
79
}
80
80
81
81
private static IEqualityComparer < TValue > GetValueComparer ( )
You can’t perform that action at this time.
0 commit comments