DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.0.2" />

 CustomAttribute

public static class CustomAttribute
Contains static methods for retrieving custom attributes.
using System; using System.Reflection; using System.Runtime.CompilerServices; namespace DotNext.Reflection { public static class CustomAttribute { [NullableContext(1)] public static bool IsDefined<[Nullable(0)] TAttribute>(this ICustomAttributeProvider member, bool inherit = false) where TAttribute : Attribute { return member.IsDefined(typeof(TAttribute), inherit); } } }