JsonPropertyInfo.ShouldSerialize 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個謂詞,決定當前屬性值是否應該序列化。
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)
屬性值
例外狀況
該 JsonPropertyInfo 實例已被鎖定,無法進一步修改。
備註
第一個參數表示父物件,第二個參數表示屬性值。
將謂詞設為 等 null 同於始終序列化屬性值。
對於來自 DefaultJsonTypeInfoResolver的合約,的 Condition 值將映射到此謂詞。