From 97719420bcabc36e42b4dfc3a14a4a1ad3711373 Mon Sep 17 00:00:00 2001
From: James Newton-King 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. 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 has a number of uses: Excludes a field or property from serialization.
@@ -59,12 +61,20 @@
JsonArrayAttribute/JsonDictionaryAttribute
+JsonPropertyAttribute
JsonIgnoreAttribute
+ 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>.