Per discussion on #1429, rename NullValueHandling to ItemNullValueHandling

This commit is contained in:
Paul Irwin
2017-11-02 11:22:27 -04:00
parent 6129124507
commit 28405e7309
4 changed files with 7 additions and 7 deletions
@@ -28,7 +28,7 @@ using System.Collections.Generic;
namespace Newtonsoft.Json.Tests.TestObjects
{
[JsonObject(NullValueHandling = NullValueHandling.Ignore)]
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class MovieWithJsonObjectNullValueHandlingIgnore
{
public string Name { get; set; }
@@ -28,7 +28,7 @@ using System.Collections.Generic;
namespace Newtonsoft.Json.Tests.TestObjects
{
[JsonObject(NullValueHandling = NullValueHandling.Include)]
[JsonObject(ItemNullValueHandling = NullValueHandling.Include)]
public class MovieWithJsonObjectNullValueHandlingInclude
{
public string Name { get; set; }
+4 -4
View File
@@ -38,7 +38,7 @@ namespace Newtonsoft.Json
// yuck. can't set nullable properties on an attribute in C#
// have to use this approach to get an unset default state
internal Required? _itemRequired;
internal NullValueHandling? _nullValueHandling;
internal NullValueHandling? _itemNullValueHandling;
/// <summary>
/// Gets or sets the member serialization.
@@ -54,10 +54,10 @@ namespace Newtonsoft.Json
/// Gets or sets the null value handling.
/// </summary>
/// <value>The null value handling.</value>
public NullValueHandling NullValueHandling
public NullValueHandling ItemNullValueHandling
{
get => _nullValueHandling ?? default(NullValueHandling);
set => _nullValueHandling = value;
get => _itemNullValueHandling ?? default(NullValueHandling);
set => _itemNullValueHandling = value;
}
/// <summary>
@@ -1511,7 +1511,7 @@ namespace Newtonsoft.Json.Serialization
if (property.NullValueHandling == null && containerAttribute is JsonObjectAttribute objectAttribute)
{
property.NullValueHandling = objectAttribute._nullValueHandling;
property.NullValueHandling = objectAttribute._itemNullValueHandling;
}
if (requiredAttribute != null)