JsonSerializerOptions.IgnoreNullValues Proprietà

Definizione

Attenzione

JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.

Ottiene o imposta un valore che indica se null i valori vengono ignorati durante la serializzazione e la deserializzazione. Il valore predefinito è false.

public:
 property bool IgnoreNullValues { bool get(); void set(bool value); };
public bool IgnoreNullValues { get; set; }
[System.Obsolete("JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.", DiagnosticId="SYSLIB0020", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public bool IgnoreNullValues { get; set; }
member this.IgnoreNullValues : bool with get, set
[<System.Obsolete("JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.", DiagnosticId="SYSLIB0020", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.IgnoreNullValues : bool with get, set
Public Property IgnoreNullValues As Boolean

Valore della proprietà

true se i valori Null vengono ignorati durante la serializzazione e la deserializzazione; in caso contrario, false.

Attributi

Eccezioni

Questa proprietà è stata impostata dopo la serializzazione o deserializzazione.

-oppure-

La proprietà DefaultIgnoreCondition è stata impostata su un valore non predefinito. Queste proprietà non possono essere usate insieme.

Commenti

Per altre informazioni, vedere Come ignorare le proprietà.

Si applica a