Collections
Last updated
Was this helpful?
Last updated
Was this helpful?
Arrays and lists:
T[]
List<T>
IEnumerable<T>
(backed by T[]
)
IReadOnlyList<T>
(backed by T[]
)
IReadOnlyCollection<T>
(backed by T[]
)
ICollection<T>
(backed by List<T>
)
IList<T>
(backed by List<T>
)
Dictionaries:
Dictionary<TKey, TValue>
IDictionary<TKey, TValue>
(backed by Dictionary
)
IReadOnlyDictionary<TKey, TValue>
(backed by Dictionary
)
Sets:
HashSet<T>
ISet<T>
(backed by HashSet
)
Collections can have and other collections as elements.
Collections require binders defined for element types (both keys and values in case of dictionaries).
Nulls are not valid as dictionary keys.
Any element binding failure results in complete collection binding failure.
or node. Empty nodes are converted to empty collections.
An empty collection is returned unless .
A custom element comparer (such as StringComparer.OrdinalIgnoreCase
for case-insensitive dictionary keys) can be achieved by wrapping the collection in a custom type and utilizing the .