AIJsonSchemaCreateContext.GetCustomAttribute<TAttribute> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves a custom attribute of a specified type that is applied to the specified schema node context.
public TAttribute? GetCustomAttribute<TAttribute> (bool inherit = false) where TAttribute : Attribute;
member this.GetCustomAttribute : bool -> 'Attribute (requires 'Attribute :> Attribute)
Public Function GetCustomAttribute(Of TAttribute As Attribute) (Optional inherit As Boolean = false) As TAttribute
Type Parameters
- TAttribute
The type of attribute to search for.
Parameters
- inherit
- Boolean
If true
, specifies to also search the ancestors of the context members for custom attributes.
Returns
TAttribute
The first occurrence of TAttribute
if found, or null
otherwise.
Remarks
This helper method resolves attributes from context locations in the following order:
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.