Bahasa

JsonPropertyInfo.ShouldSerialize Properti

Definisi

Mendapatkan atau menetapkan predikat yang menentukan apakah nilai properti saat ini harus diserialisasikan.

public:
 property Func<System::Object ^, System::Object ^, bool> ^ ShouldSerialize { Func<System::Object ^, System::Object ^, bool> ^ get(); void set(Func<System::Object ^, System::Object ^, bool> ^ value); };
public Func<object,object?,bool>? ShouldSerialize { get; set; }
member this.ShouldSerialize : Func<obj, obj, bool> with get, set
Public Property ShouldSerialize As Func(Of Object, Object, Boolean)

Nilai Properti

Pengecualian

JsonPropertyInfo Instans telah dikunci untuk modifikasi lebih lanjut.

Keterangan

Parameter pertama menunjukkan objek induk, dan parameter kedua menunjukkan nilai properti.

Mengatur predikat ke null setara dengan selalu membuat serialisasi nilai properti.

Untuk kontrak yang berasal dari DefaultJsonTypeInfoResolver, nilai Condition akan dipetakan ke predikat ini.

Berlaku untuk