JsonConverterAttribute クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
プロパティまたは型に配置された場合、使用するコンバーターの型が指定されます。
public ref class JsonConverterAttribute : System::Text::Json::Serialization::JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)]
public class JsonConverterAttribute : System.Text.Json.Serialization.JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)]
public class JsonConverterAttribute : System.Text.Json.Serialization.JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)]
public class JsonConverterAttribute : System.Text.Json.Serialization.JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)>]
type JsonConverterAttribute = class
inherit JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)>]
type JsonConverterAttribute = class
inherit JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false)>]
type JsonConverterAttribute = class
inherit JsonAttribute
Public Class JsonConverterAttribute
Inherits JsonAttribute
- 継承
- 属性
注釈
指定したコンバーターの型は から JsonConverter派生している必要があります。
プロパティに配置すると、指定したコンバーターが常に使用されます。
型に配置すると、互換性のあるコンバーターがコレクションに追加されていないか、同じ型のプロパティに別JsonConverterAttributeのコンバーターが存在JsonSerializerOptions.Convertersしない限り、指定したコンバーターが使用されます。
詳細については、「 JSON シリアル化用のカスタム コンバーターを記述する方法」を参照してください。
コンストラクター
JsonConverterAttribute() |
JsonConverterAttribute の新しいインスタンスを初期化します。 |
JsonConverterAttribute(Type) |
指定したコンバーターの型を使用して、JsonConverterAttribute の新しいインスタンスを初期化します。 |
プロパティ
ConverterType |
JsonConverterAttribute の型を取得します。型を指定せずに作成されている場合は |
TypeId |
派生クラスで実装されると、この Attribute の一意の識別子を取得します。 (継承元 Attribute) |
メソッド
CreateConverter(Type) |
派生クラスでオーバーライドされ、ConverterType が |
Equals(Object) |
このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。 (継承元 Attribute) |
GetHashCode() |
このインスタンスのハッシュ コードを返します。 (継承元 Attribute) |
GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
IsDefaultAttribute() |
派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。 (継承元 Attribute) |
Match(Object) |
派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (継承元 Attribute) |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示