JsonExtensionDataAttribute クラス

定義

IDictionary<TKey,TValue>型のプロパティに配置すると、一致するメンバーを持たないプロパティは、逆シリアル化中にそのディクショナリに追加され、シリアル化中に書き込まれます。

public ref class JsonExtensionDataAttribute sealed : System::Text::Json::Serialization::JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false)]
public sealed class JsonExtensionDataAttribute : System.Text.Json.Serialization.JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)]
public sealed class JsonExtensionDataAttribute : System.Text.Json.Serialization.JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false)>]
type JsonExtensionDataAttribute = class
    inherit JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false)>]
type JsonExtensionDataAttribute = class
    inherit JsonAttribute
Public NotInheritable Class JsonExtensionDataAttribute
Inherits JsonAttribute
継承
JsonExtensionDataAttribute
属性

注釈

ディクショナリの TKey 値は Stringする必要があり、 TValueJsonElement または Objectする必要があります。

逆シリアル化中、 Objectを使用する場合、"null" JSON 値は null オブジェクト参照として扱われ、 JsonElementを使用する場合、"null" は jsonElement として扱われ、 ValueKindJsonValueKind.Null に設定されます。

シリアル化中、拡張データ プロパティの名前は JSON に含まれません。拡張データに含まれるデータは、JSON オブジェクトのプロパティとしてシリアル化されます。

この拡張データ属性を持つ型に複数のプロパティがある場合、またはプロパティ自体が正しい IDictionary<TKey,TValue> 型でない場合は、その型の最初のシリアル化または逆シリアル化中に InvalidOperationException がスローされます。

詳細については、「 System.Text.Json を使用してオーバーフロー JSON を処理する方法」を参照してください

コンストラクター

名前 説明
JsonExtensionDataAttribute()

JsonExtensionDataAttribute クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
TypeId

派生クラスで実装されている場合は、この Attributeの一意の識別子を取得します。

(継承元 Attribute)

メソッド

名前 説明
Equals(Object)

このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされた場合、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラスでオーバーライドされた場合、このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象