Interface IGenericCustomAttributeProvider
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Extends ICustomAttributeProvider with generic methods for attribute resolution.
public interface IGenericCustomAttributeProvider : ICustomAttributeProvider
- Inherited Members
- Extension Methods
Methods
GetCustomAttribute<TAttribute>(bool)
Retrieves a custom attribute defined on this member.
TAttribute? GetCustomAttribute<TAttribute>(bool inherit = true) where TAttribute : Attribute
Parameters
Returns
- TAttribute
A custom attribute that matches
TAttribute, or null if no such attribute is found.
Type Parameters
TAttributeThe type of attribute to search for.
GetCustomAttributes<TAttribute>(bool)
Retrieves a collection of custom attributes of a specified type that are applied to a specified member.
IEnumerable<TAttribute> GetCustomAttributes<TAttribute>(bool inherit = true) where TAttribute : Attribute
Parameters
Returns
- IEnumerable<TAttribute>
A collection of the custom attributes that are applied to element and that match
TAttribute, or an empty collection if no such attributes exist.
Type Parameters
TAttributeThe type of attribute to search for.
IsDefined<TAttribute>(bool)
Checks if a particular custom attribute is defined on this member.
bool IsDefined<TAttribute>(bool inherit = true) where TAttribute : Attribute
Parameters
Returns
Type Parameters
TAttributeThe type of attribute to search for.