IndexOf<>(source, predicate, startIndex) IndexOf<>(source, element, comparer) JoinString<>(values, separator, prefix, suffix, lastSeparator) Order<>(source, comparer) SkipLast<>(source, count, throwIfNotEnough) Split<>(splitWhat, splitWhere) Split<>(source, chunkSize) ToDictionary2<>(source, key1Selector, key2Selector, comparer1, comparer2) ToDictionary2<>(source, key1Selector, key2Selector, elementSelector, comparer1, comparer2)
Legend Class Struct Enum Interface Delegate | Constructor Method Property Event Field |
| Extension method: Dictionary<TKey1, Dictionary<TKey2, TSource>> ToDictionary2<TSource, TKey1, TKey2>(this IEnumerable<TSource>, Func<TSource, TKey1>, Func<TSource, TKey2>, IEqualityComparer<TKey1>, IEqualityComparer<TKey2>)Declarationpublic static Dictionary<TKey1, Dictionary<TKey2, TSource>> ToDictionary2<TSource, TKey1, TKey2>(
this IEnumerable<TSource> source,
Func<TSource, TKey1> key1Selector,
Func<TSource, TKey2> key2Selector,
IEqualityComparer<TKey1> comparer1 = null,
IEqualityComparer<TKey2> comparer2 = null
) Summary
Creates a two-level dictionary from an enumerable collection according to two specified key selector functions
and optional key comparers. Generic type parametersTSource |
The type of the elements of source. | TKey1 |
The type of the keys returned by key1Selector. | TKey2 |
The type of the keys returned by key2Selector. |
Parametersthis IEnumerable<TSource> | source |
Source collection to create a dictionary from. | Func<TSource, TKey1> | key1Selector |
A function to extract the first-level key from each element. | Func<TSource, TKey2> | key2Selector |
A function to extract the second-level key from each element. | IEqualityComparer<TKey1> | comparer1 |
An equality comparer to compare the first-level keys. | IEqualityComparer<TKey2> | comparer2 |
An equality comparer to compare the second-level keys. |
|