@@ -17,14 +17,14 @@ internal static bool IsTypeIgnored(Type type)
1717 private static readonly ClrCache < object > deepClassToCache = new ClrCache < object > ( ) ;
1818 private static readonly ClrCache < object > shallowClassToCache = new ClrCache < object > ( ) ;
1919 private static readonly ConcurrentLazyCache < object > typeConvertCache = new ConcurrentLazyCache < object > ( ) ;
20- private static readonly ClrCache < object ? > fieldCache = new ClrCache < object ? > ( ) ;
20+ private static readonly GenericClrCache < Tuple < Type , string > , object ? > fieldCache = new GenericClrCache < Tuple < Type , string > , object ? > ( ) ;
2121 private static readonly ClrCache < Dictionary < string , Type > > ignoredEventInfoCache = new ClrCache < Dictionary < string , Type > > ( ) ;
2222 private static readonly ClrCache < List < MemberInfo > > allMembersCache = new ClrCache < List < MemberInfo > > ( ) ;
2323 private static readonly GenericClrCache < MemberInfo , bool > memberIgnoreStatusCache = new GenericClrCache < MemberInfo , bool > ( ) ;
2424 private static readonly ClrCache < bool > typeContainsIgnoredMembersCache = new ClrCache < bool > ( ) ;
2525 private static readonly ClrCache < object > specialTypesCache = new ClrCache < object > ( ) ;
2626
27- public static object ? GetOrAddField ( Type type , Func < Type , object ? > valueFactory ) => fieldCache . GetOrAdd ( type , valueFactory ) ;
27+ public static object ? GetOrAddField ( Type type , string name , Func < Type , object ? > valueFactory ) => fieldCache . GetOrAdd ( new Tuple < Type , string > ( type , name ) , k => valueFactory ( k . Item1 ) ) ;
2828 public static object ? GetOrAddClass ( Type type , Func < Type , object ? > valueFactory ) => classCache . GetOrAdd ( type , valueFactory ) ;
2929 public static object ? GetOrAddStructAsObject ( Type type , Func < Type , object ? > valueFactory ) => structCache . GetOrAdd ( type , valueFactory ) ;
3030 public static object GetOrAddDeepClassTo ( Type type , Func < Type , object > valueFactory ) => deepClassToCache . GetOrAdd ( type , valueFactory ) ;
0 commit comments