JsonConverterAttribute Sınıf

Tanım

Bir özellik veya türe yerleştirildiğinde, kullanılacak dönüştürücü türünü belirtir.

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
Devralma
JsonConverterAttribute
Öznitelikler

Açıklamalar

Belirtilen dönüştürücü türünün türünden JsonConvertertüretilmiş olması gerekir.

Bir özelliğe yerleştirildiğinde, belirtilen dönüştürücü her zaman kullanılır.

Bir türe yerleştirildiğinde, koleksiyona uyumlu bir dönüştürücü eklenmediği JsonSerializerOptions.Converters veya aynı türdeki bir özellikte başka JsonConverterAttribute bir dönüştürücü olmadığı sürece belirtilen dönüştürücü kullanılır.

Daha fazla bilgi için bkz. JSON serileştirmesi için özel dönüştürücüler yazma.

Oluşturucular

JsonConverterAttribute()

öğesinin yeni bir örneğini JsonConverterAttributebaşlatır.

JsonConverterAttribute(Type)

Belirtilen dönüştürücü türüyle yeni bir örneğini JsonConverterAttribute başlatır.

Özellikler

ConverterType

türünün veya null türü JsonConverterAttributeolmadan oluşturulup oluşturulmadığını alır.

TypeId

Türetilmiş bir sınıfta uygulandığında, bu Attributeiçin benzersiz bir tanımlayıcı alır.

(Devralındığı yer: Attribute)

Yöntemler

CreateConverter(Type)

Türetilmiş bir sınıfta ve ConverterType olan nullgeçersiz kılındığında, türetilmiş sınıfın ek durum geçirmek için bir JsonConverter oluşturmasına izin verir.

Equals(Object)

Bu örneğin belirtilen bir nesneye eşit olup olmadığını gösteren bir değeri döndürür.

(Devralındığı yer: Attribute)
GetHashCode()

Bu örneğe ilişkin karma kodu döndürür.

(Devralındığı yer: Attribute)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
IsDefaultAttribute()

Türetilmiş bir sınıfta geçersiz kılındığında, bu örneğin değerinin türetilmiş sınıf için varsayılan değer olup olmadığını gösterir.

(Devralındığı yer: Attribute)
Match(Object)

Türetilmiş bir sınıfta geçersiz kılındığında, bu örneğin belirtilen bir nesneye eşit olup olmadığını gösteren bir değer döndürür.

(Devralındığı yer: Attribute)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)

Şunlara uygulanır