JsonSerializerOptions.IgnoreNullValues Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.
Gets or sets a value that indicates whether null
values are ignored during serialization and deserialization. The default value is false
.
public:
property bool IgnoreNullValues { bool get(); void set(bool value); };
[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; }
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}")>]
member this.IgnoreNullValues : bool with get, set
member this.IgnoreNullValues : bool with get, set
Public Property IgnoreNullValues As Boolean
true
if null values are ignored during serialization and deserialization; otherwise, false
.
- Attributes
This property was set after serialization or deserialization has occurred.
-or-
DefaultIgnoreCondition has been set to a non-default value. These properties cannot be used together.
For more information, see How to ignore properties.
Produkt | Versioner (Föråldrad) |
---|---|
.NET | Core 3.0, Core 3.1, 5 (6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10) |
.NET Standard | 2.0 (package-provided) |
Feedback om .NET
.NET är ett öppen källkod projekt. Välj en länk för att ge feedback: