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
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET