From 97719420bcabc36e42b4dfc3a14a4a1ad3711373 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Mon, 23 Apr 2012 20:44:36 +1200 Subject: [PATCH] -Documentation --- Doc/SerializationAttributes.html | 10 ++++++++++ Doc/SerializationGuide.html | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/Doc/SerializationAttributes.html b/Doc/SerializationAttributes.html index 76d68b4b..756919d9 100644 --- a/Doc/SerializationAttributes.html +++ b/Doc/SerializationAttributes.html @@ -19,6 +19,8 @@ @@ -59,12 +61,20 @@

Json.NET serializes .NET classes that implement IEnumerable as an JSON array populated with the IEnumerable values. Placing the JsonPropertyAttribute overrides this behavor and forces the serializer to serialize the class's fields and properties.

+ +
JsonArrayAttribute/JsonDictionaryAttribute
+

The JsonArrayAttribute and JsonDictionaryAttributes are used to specified + whether a class is serialized as that collection type.

+

The collection attributes have options to customize the JsonConverter, type name handling + and reference handling that are applied to collection items.

JsonPropertyAttribute

JsonPropertyAttribute has a number of uses:

JsonIgnoreAttribute

Excludes a field or property from serialization.

diff --git a/Doc/SerializationGuide.html b/Doc/SerializationGuide.html index 646fb9ab..4b8ce867 100644 --- a/Doc/SerializationGuide.html +++ b/Doc/SerializationGuide.html @@ -234,6 +234,9 @@ In situations where a JSON array is not wanted the JsonObjectAttribute can be placed on a .NET type that implements IEnumerable to force the type to be serialized as a JSON object instead.

+

+ JsonArrayAttribute has options on it to customize the JsonConverter, type name handling + and reference handling that are applied to collection items.

Note that if TypeNameHandling or PreserveReferencesHandling has been enabled for JSON arrays on the serializer then JSON arrays are wrapped it a containing object. @@ -254,6 +257,9 @@ serializing and properties on the JSON object will be added to the dictionary's name/values when deserializing. Additional members on the .NET dictionary are ignored during serialization.

+

+ JsonDictionaryAttribute has options on it to customize the JsonConverter, type name handling + and reference handling that are applied to collection items.

When deserializing if a member is typed as the interface IDictionary<TKey, TValue> then it will be deserialized as a Dictionary<TKey, TValue>.