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

ReflectionAttributeProvider

Provides methods to get attributes from a Type, MemberInfo, ParameterInfo or Assembly.
using Newtonsoft.Json.Utilities; using System; using System.Collections.Generic; namespace Newtonsoft.Json.Serialization { public class ReflectionAttributeProvider : IAttributeProvider { private readonly object _attributeProvider; public ReflectionAttributeProvider(object attributeProvider) { ValidationUtils.ArgumentNotNull(attributeProvider, "attributeProvider"); _attributeProvider = attributeProvider; } public IList<Attribute> GetAttributes(bool inherit) { return ReflectionUtils.GetAttributes(_attributeProvider, null, inherit); } public IList<Attribute> GetAttributes(Type attributeType, bool inherit) { return ReflectionUtils.GetAttributes(_attributeProvider, attributeType, inherit); } } }