Added IgnoreIsSpecifiedMembers to DefaultContractResolver for better performance.

This commit is contained in:
TylerBrinkley
2017-06-16 10:47:41 -05:00
parent 5c13d7af65
commit 967761c216
@@ -143,6 +143,14 @@ namespace Newtonsoft.Json.Serialization
public bool IgnoreSerializableAttribute { get; set; }
#endif
/// <summary>
/// Gets or sets a value indicating whether to ignore IsSpecified members when serializing and deserializing tyeps.
/// </summary>
/// <value>
/// <c>true</c> if the IsSpecified members will be ignored when serializing and deserializing types; otherwise, <c>false</c>.
/// </value>
public bool IgnoreIsSpecifiedMembers { get; set; }
/// <summary>
/// Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized.
/// </summary>
@@ -1399,7 +1407,10 @@ namespace Newtonsoft.Json.Serialization
}
property.ShouldSerialize = CreateShouldSerializeTest(member);
SetIsSpecifiedActions(property, member, allowNonPublicAccess);
if (!IgnoreIsSpecifiedMembers)
{
SetIsSpecifiedActions(property, member, allowNonPublicAccess);
}
return property;
}