Class CollectionConverter<T, TList, TDictionary>
Converts a complex JSON object into .NET primitives. For arrays, the configured list collection type
TList
is used. Objects are deserialized into the configured dictionary type
TDictionary
, storing each object property as a
KeyValuePair<TKey, TValue>.
Inheritance
Newtonsoft.Json.JsonConverter
CollectionConverter<T, TList, TDictionary>
Assembly: XploRe.Json.dll
Syntax
public class CollectionConverter<T, TList, TDictionary> : JsonConverter where TList : ICollection<T>, new ()where TDictionary : IDictionary<string, T>, new ()
Type Parameters
Name |
Description |
T |
Type used for items. If a deserialised value cannot be converted into T , an
exception is thrown. Can be used to enforce a certain data type, e.g. string, for all primitives. To retain
the JSON type of a primitive, use Object.
|
TList |
List type that implements System.Collections.Generic.ICollection<> that is used for arrays.
Must provide a parameterless constructor.
|
TDictionary |
Dictionary type that implements System.Collections.Generic.IDictionary<, > that is used for
objects whose properties are stored as KeyValuePair<TKey, TValue>s. Keys are
always Strings.
|
Constructors
Properties
Methods