JsonSerializerOptions.DefaultIgnoreCondition 属性

定义

获取或设置一个值,该值确定序列化或反序列化期间何时忽略具有默认值的属性。 默认值为 Never

public:
 property System::Text::Json::Serialization::JsonIgnoreCondition DefaultIgnoreCondition { System::Text::Json::Serialization::JsonIgnoreCondition get(); void set(System::Text::Json::Serialization::JsonIgnoreCondition value); };
public System.Text.Json.Serialization.JsonIgnoreCondition DefaultIgnoreCondition { get; set; }
member this.DefaultIgnoreCondition : System.Text.Json.Serialization.JsonIgnoreCondition with get, set
Public Property DefaultIgnoreCondition As JsonIgnoreCondition

属性值

例外

此属性设置为 Always.

在序列化或反序列化发生后设置此属性。

-或-

IgnoreNullValues 已设置为 true. 这些属性不能一起使用。

适用于