-
Notifications
You must be signed in to change notification settings - Fork 41
Supporting IEnumerable of T based types
Stefan edited this page Dec 16, 2018
·
2 revisions
Serialization will simply use the Enumerator. Deserialization is a bit more complicated:
-
ISet<T>
will useHashSet<T>
-
IDictionary<TKey, TValue>
/IReadOnlyDictionary<TKey, TValue>
will useDictionary<TKey, TValue>
-
IList<T>
will useList<T>
-
IEnumerable<T>
will useT[]
Deserialization of types implementing IEnumerable<T>
is supported as long they have a public constructor with a single IEnumerable<T>
parameter.
Stack<T>
and ConcurrentStack<T>
are not supported as it would require reversing the input prior to creating the type for deserialization.