JsonSerializerOptions.IgnoreNullValues Property

Definition

Gets or sets a value that determines whether null values are ignored during serialization and deserialization. The default value is false.

public:
 property bool IgnoreNullValues { bool get(); void set(bool value); };
public bool IgnoreNullValues { get; set; }
member this.IgnoreNullValues : bool with get, set
Public Property IgnoreNullValues As Boolean

Property Value

Boolean

true to ignore null values during serialization and deserialization; otherwise, see langword="false" />.

Exceptions

This property was set after serialization or deserialization has occurred.

Remarks

For more information, see Exclude all null value properties and Ignore null when deserializing.

Applies to