/
JsonIgnoreCondition.cs
34 lines (33 loc) · 1.45 KB
/
JsonIgnoreCondition.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Text.Json.Serialization
{
/// <summary>
/// When specified on <see cref="JsonSerializerOptions.DefaultIgnoreCondition"/>,
/// determines when properties and fields across the type graph are ignored.
/// When specified on <see cref="JsonIgnoreAttribute.Condition"/>, controls whether
/// a property is ignored during serialization and deserialization. This option
/// overrides the setting on <see cref="JsonSerializerOptions.DefaultIgnoreCondition"/>.
/// </summary>
public enum JsonIgnoreCondition
{
/// <summary>
/// Property is never ignored during serialization or deserialization.
/// </summary>
Never = 0,
/// <summary>
/// Property is always ignored during serialization and deserialization.
/// </summary>
Always = 1,
/// <summary>
/// If the value is the default, the property is ignored during serialization.
/// This is applied to both reference and value-type properties and fields.
/// </summary>
WhenWritingDefault = 2,
/// <summary>
/// If the value is <see langword="null"/>, the property is ignored during serialization.
/// This is applied only to reference-type properties and fields.
/// </summary>
WhenWritingNull = 3,
}
}