Skip to content

Commit

Permalink
Improve obsoletion message for IgnoreNullValues (#36886)
Browse files Browse the repository at this point in the history
  • Loading branch information
layomia committed May 22, 2020
1 parent 702e2d0 commit 2d34393
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public int DefaultBufferSize
/// Thrown if this property is set after serialization or deserialization has occurred.
/// or <see cref="DefaultIgnoreCondition"/> has been set to a non-default value. These properties cannot be used together.
/// </exception>
[Obsolete("Use DefaultIgnoreCondition instead.", error: false)]
[Obsolete("To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingDefault.", error: false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool IgnoreNullValues
{
Expand All @@ -211,7 +211,7 @@ public bool IgnoreNullValues
{
VerifyMutable();

if (value == true && _defaultIgnoreCondition != JsonIgnoreCondition.Never)
if (value && _defaultIgnoreCondition != JsonIgnoreCondition.Never)
{
Debug.Assert(_defaultIgnoreCondition == JsonIgnoreCondition.WhenWritingDefault);
throw new InvalidOperationException(SR.DefaultIgnoreConditionAlreadySpecified);
Expand Down

0 comments on commit 2d34393

Please sign in to comment.