Json.NET - Quick Starts & API Documentation
DefaultValueHandling Enumeration
Namespaces ► Newtonsoft.Json ► DefaultValueHandling
Specifies default value handling options for the JsonSerializer.
Declaration Syntax
C# | Visual Basic | Visual C++ |
[FlagsAttribute] public enum DefaultValueHandling
<FlagsAttribute> _ Public Enumeration DefaultValueHandling
[FlagsAttribute] public enum class DefaultValueHandling
Members
Member | Description |
---|---|
Include |
Include members where the member value is the same as the member's default value when serializing objects.
Included members are written to JSON. Has no effect when deserializing.
|
Ignore |
Ignore members where the member value is the same as the member's default value when serializing objects
so that is is not written to JSON, and ignores setting members when the JSON value equals the member's default value.
|
Populate |
Members with a default value but no JSON will be set to their default value when deserializing.
|
IgnoreAndPopulate |
Ignore members where the member value is the same as the member's default value when serializing objects
and sets members to their default value when deserializing.
|