AIJsonSchemaCreateContext.GetCustomAttribute<TAttribute> メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定したスキーマ ノード コンテキストに適用される、指定した型のカスタム属性を取得します。
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
型パラメーター
- TAttribute
検索する属性の種類。
パラメーター
- inherit
- Boolean
true場合は、コンテキスト メンバーの先祖も検索してカスタム属性を検索するように指定します。
返品
TAttribute
見つかった場合は TAttribute の最初の出現、それ以外の場合は null 。
注釈
このヘルパー メソッドは、コンテキストの場所から次の順序で属性を解決します。
- コンテキストのプロパティで指定された属性 (指定されている場合)。
- コンテキストのコンストラクター パラメーターで指定された属性 (指定されている場合)。
- コンテキストの型で指定された属性。