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.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.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.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)>]
type JsonConverterAttribute = class
    inherit 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.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ürde bir özellikte başka bir JsonConverterAttribute 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ştirme için özel dönüştürücüler yazma.

Oluşturucular

Name Description
JsonConverterAttribute()

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

JsonConverterAttribute(Type)

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

Özellikler

Name Description
ConverterType

türünün türünü JsonConverterAttributeveya null türü olmadan 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

Name Description
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ğer döndürür.

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

Bu örneğin karma kodunu döndürür.

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

Geçerli örneğin Type 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 Objectbasit bir kopyasını oluşturur.

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

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

(Devralındığı yer: Object)

Şunlara uygulanır