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 namespace Newtonsoft.Json.Tests.TestObjects
{ {
[JsonObject(NullValueHandling = NullValueHandling.Ignore)] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class MovieWithJsonObjectNullValueHandlingIgnore public class MovieWithJsonObjectNullValueHandlingIgnore
{ {
public string Name { get; set; } public string Name { get; set; }
@@ -28,7 +28,7 @@ using System.Collections.Generic;
namespace Newtonsoft.Json.Tests.TestObjects namespace Newtonsoft.Json.Tests.TestObjects
{ {
[JsonObject(NullValueHandling = NullValueHandling.Include)] [JsonObject(ItemNullValueHandling = NullValueHandling.Include)]
public class MovieWithJsonObjectNullValueHandlingInclude public class MovieWithJsonObjectNullValueHandlingInclude
{ {
public string Name { get; set; } 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# // yuck. can't set nullable properties on an attribute in C#
// have to use this approach to get an unset default state // have to use this approach to get an unset default state
internal Required? _itemRequired; internal Required? _itemRequired;
internal NullValueHandling? _nullValueHandling; internal NullValueHandling? _itemNullValueHandling;
/// <summary> /// <summary>
/// Gets or sets the member serialization. /// Gets or sets the member serialization.
@@ -54,10 +54,10 @@ namespace Newtonsoft.Json
/// Gets or sets the null value handling. /// Gets or sets the null value handling.
/// </summary> /// </summary>
/// <value>The null value handling.</value> /// <value>The null value handling.</value>
public NullValueHandling NullValueHandling public NullValueHandling ItemNullValueHandling
{ {
get => _nullValueHandling ?? default(NullValueHandling); get => _itemNullValueHandling ?? default(NullValueHandling);
set => _nullValueHandling = value; set => _itemNullValueHandling = value;
} }
/// <summary> /// <summary>
@@ -1511,7 +1511,7 @@ namespace Newtonsoft.Json.Serialization
if (property.NullValueHandling == null && containerAttribute is JsonObjectAttribute objectAttribute) if (property.NullValueHandling == null && containerAttribute is JsonObjectAttribute objectAttribute)
{ {
property.NullValueHandling = objectAttribute._nullValueHandling; property.NullValueHandling = objectAttribute._itemNullValueHandling;
} }
if (requiredAttribute != null) if (requiredAttribute != null)