JsonSerializerOptions.DefaultIgnoreCondition Property

Definition

Gets or sets a value that determines when properties with default values are ignored during serialization or deserialization. The default value is Never.

C#
public System.Text.Json.Serialization.JsonIgnoreCondition DefaultIgnoreCondition { get; set; }

Property Value

Exceptions

This property is set to Always.

This property is set after serialization or deserialization has occurred.

-or-

IgnoreNullValues has been set to true. These properties cannot be used together.

Applies to

Product Versions
.NET 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)