-Added IgnoreAll to DefaultValueHandling which ignores all default class/struct/privative values

-Added support for DataMemberAttribute's EmitDefaultValue
-Fixed losing decimal precision when writing JValues
-Fixed error when calling ToList on empty JObjects and JArrays
This commit is contained in:
James Newton-King
2012-09-01 13:34:07 +12:00
parent 028c287cff
commit d9c8d78d77
20 changed files with 312 additions and 39 deletions
+9 -2
View File
@@ -125,11 +125,18 @@
</tableHeader>
<row>
<entry><para><legacyBold>Include</legacyBold></para></entry>
<entry><para>By default Json.NET will write a field/property value to JSON when serializing if the value is the same as the field/property's default value. The Json.NET deserializer will continue setting a field/property if the JSON value is the same as the default value.</para></entry>
<entry><para>By default Json.NET will write a field/property value to JSON when serializing if the value is the same as the field/property's default value.
The Json.NET deserializer will continue setting a field/property if the JSON value is the same as the default value.</para></entry>
</row>
<row>
<entry><para><legacyBold>Ignore</legacyBold></para></entry>
<entry><para>Json.NET will skip writing a field/property value to JSON if the value is the same as the field/property's default value. The Json.NET deserializer will skip setting a .NET object's field/property if the JSON value is the same as the default value.</para></entry>
<entry><para>Json.NET will skip writing a field/property value to JSON if the value is null or is the same as the value specified in field/property's <codeEntityReference>T:System.ComponentModel.DefaultValueAttribute</codeEntityReference>. The Json.NET deserializer will skip setting a .NET object's field/property if the JSON value is the same as the default value.</para></entry>
</row>
<row>
<entry><para><legacyBold>IgnoreAll</legacyBold></para></entry>
<entry><para>Json.NET will skip writing a field/property value to JSON if the value is the same as the field/property's default value, or the custom
value specified in <codeEntityReference>T:System.ComponentModel.DefaultValueAttribute</codeEntityReference> if it is present. The Json.NET deserializer
will skip setting a .NET object's field/property if the JSON value is the same as the default value.</para></entry>
</row>
</table>
<para>DefaultValueHandling can also be customized on individual properties with JsonPropertyAttribute.</para>