<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />

CachedAttributeGetter<T>

static class CachedAttributeGetter<T> where T : Attribute
using Newtonsoft.Json.Utilities; using System; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace Newtonsoft.Json.Serialization { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Newtonsoft.Json relies on reflection over types that may be removed when trimming.")] [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Newtonsoft.Json relies on dynamically creating types that may not be available with Ahead of Time compilation.")] internal static class CachedAttributeGetter<T> where T : Attribute { [System.Runtime.CompilerServices.Nullable(new byte[] { 1, 1, 2 })] private static readonly ThreadSafeStore<object, T> TypeAttributeCache = new ThreadSafeStore<object, T>(JsonTypeReflector.GetAttribute<T>); [System.Runtime.CompilerServices.NullableContext(1)] [return: System.Runtime.CompilerServices.Nullable(2)] public static T GetAttribute(object type) { return TypeAttributeCache.Get(type); } } }