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> :
4545 where TEnum : SmartEnum < TEnum , TValue >
4646 where TValue : IEquatable < TValue > , IComparable < TValue >
4747 {
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 ) ;
5050
5151 static readonly Lazy < Dictionary < string , TEnum > > _fromName =
5252 new Lazy < Dictionary < string , TEnum > > ( ( ) => _enumOptions . Value . ToDictionary ( item => item . Name ) ) ;
@@ -67,15 +67,15 @@ public abstract class SmartEnum<TEnum, TValue> :
6767 return dictionary ;
6868 } ) ;
6969
70- private static TEnum [ ] GetAllOptions ( )
70+ private static List < TEnum > GetAllOptions ( )
7171 {
7272 Type baseType = typeof ( TEnum ) ;
7373 return Assembly . GetAssembly ( baseType )
7474 . GetTypes ( )
7575 . Where ( t => baseType . IsAssignableFrom ( t ) )
7676 . SelectMany ( t => t . GetFieldsOfType < TEnum > ( ) )
7777 . OrderBy ( t => t . Name )
78- . ToArray ( ) ;
78+ . ToList ( ) ;
7979 }
8080
8181 private static IEqualityComparer < TValue > GetValueComparer ( )
You can’t perform that action at this time.
0 commit comments