@@ -26,14 +26,14 @@ public static class DynamicClassFactory
26
26
private static readonly CustomAttributeBuilder DebuggerHiddenAttributeBuilder = new CustomAttributeBuilder ( typeof ( DebuggerHiddenAttribute ) . GetConstructor ( Type . EmptyTypes ) , new object [ 0 ] ) ;
27
27
28
28
private static readonly ConstructorInfo ObjectCtor = typeof ( object ) . GetConstructor ( Type . EmptyTypes ) ;
29
- #if DNXCORE50
29
+ #if DNXCORE50 || DOTNET5_4
30
30
private static readonly MethodInfo ObjectToString = typeof ( object ) . GetMethod ( "ToString" , BindingFlags . Instance | BindingFlags . Public ) ;
31
31
#else
32
32
private static readonly MethodInfo ObjectToString = typeof ( object ) . GetMethod ( "ToString" , BindingFlags . Instance | BindingFlags . Public , null , Type . EmptyTypes , null ) ;
33
33
#endif
34
34
35
35
private static readonly ConstructorInfo StringBuilderCtor = typeof ( StringBuilder ) . GetConstructor ( Type . EmptyTypes ) ;
36
- #if DNXCORE50
36
+ #if DNXCORE50 || DOTNET5_4
37
37
private static readonly MethodInfo StringBuilderAppendString = typeof ( StringBuilder ) . GetMethod ( "Append" , new [ ] { typeof ( string ) } ) ;
38
38
private static readonly MethodInfo StringBuilderAppendObject = typeof ( StringBuilder ) . GetMethod ( "Append" , new [ ] { typeof ( object ) } ) ;
39
39
#else
@@ -43,7 +43,7 @@ public static class DynamicClassFactory
43
43
44
44
private static readonly Type EqualityComparer = typeof ( EqualityComparer < > ) ;
45
45
46
- #if DNXCORE50
46
+ #if DNXCORE50 || DOTNET5_4
47
47
private static readonly Type EqualityComparerGenericArgument = TypeExtensions . GetGenericArguments ( EqualityComparer ) [ 0 ] ;
48
48
private static readonly MethodInfo EqualityComparerDefault = EqualityComparer . GetMethod ( "get_Default" , BindingFlags . Static | BindingFlags . Public ) ;
49
49
private static readonly MethodInfo EqualityComparerEquals = EqualityComparer . GetMethod ( "Equals" , new [ ] { EqualityComparerGenericArgument , EqualityComparerGenericArgument } ) ;
@@ -254,7 +254,7 @@ public static Type CreateType(IList<DynamicProperty> properties)
254
254
255
255
for ( int i = 0 ; i < names . Length ; i ++ )
256
256
{
257
- #if DNXCORE50
257
+ #if DNXCORE50 || DOTNET5_4
258
258
Type equalityComparerT = EqualityComparer . MakeGenericType ( generics [ i ] . AsType ( ) ) ;
259
259
#else
260
260
Type equalityComparerT = EqualityComparer . MakeGenericType ( generics [ i ] ) ;
@@ -290,7 +290,7 @@ public static Type CreateType(IList<DynamicProperty> properties)
290
290
ilgeneratorToString . Emit ( OpCodes . Ldloc_0 ) ;
291
291
ilgeneratorToString . Emit ( OpCodes . Ldarg_0 ) ;
292
292
ilgeneratorToString . Emit ( OpCodes . Ldfld , fields [ i ] ) ;
293
- #if DNXCORE50
293
+ #if DNXCORE50 || DOTNET5_4
294
294
ilgeneratorToString . Emit ( OpCodes . Box , generics [ i ] . AsType ( ) ) ;
295
295
#else
296
296
ilgeneratorToString . Emit ( OpCodes . Box , generics [ i ] ) ;
@@ -333,7 +333,7 @@ public static Type CreateType(IList<DynamicProperty> properties)
333
333
ilgeneratorToString . Emit ( OpCodes . Callvirt , ObjectToString ) ;
334
334
ilgeneratorToString . Emit ( OpCodes . Ret ) ;
335
335
336
- #if DNXCORE50
336
+ #if DNXCORE50 || DOTNET5_4
337
337
type = tb . CreateTypeInfo ( ) . AsType ( ) ;
338
338
#else
339
339
type = tb . CreateType ( ) ;
0 commit comments