ImmutableSortedDictionary::ToImmutableSortedDictionary<TSource, TKey, TValue> Method (IEnumerable<TSource>^, Func<TSource, TKey>^, Func<TSource, TValue>^, IComparer<TKey>^, IEqualityComparer<TValue>^)
Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key and value comparers.
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
public: generic<typename TSource, typename TKey, typename TValue> [ExtensionAttribute] static ImmutableSortedDictionary<TKey, TValue>^ ToImmutableSortedDictionary( IEnumerable<TSource>^ source, Func<TSource, TKey>^ keySelector, Func<TSource, TValue>^ elementSelector, IComparer<TKey>^ keyComparer, IEqualityComparer<TValue>^ valueComparer )
Parameters
- source
-
Type:
System.Collections.Generic::IEnumerable<TSource>^
The sequence to enumerate to generate the dictionary.
- keySelector
-
Type:
System::Func<TSource, TKey>^
The function that will produce the key for the dictionary from each sequence element.
- elementSelector
-
Type:
System::Func<TSource, TValue>^
The function that will produce the value for the dictionary from each sequence element.
- keyComparer
-
Type:
System.Collections.Generic::IComparer<TKey>^
The key comparer to use for the dictionary.
- valueComparer
-
Type:
System.Collections.Generic::IEqualityComparer<TValue>^
The value comparer to use for the dictionary.
Return Value
Type: System.Collections.Immutable::ImmutableSortedDictionary<TKey, TValue>^An immutable sorted dictionary that contains the items in the specified sequence.
Type Parameters
- TSource
The type of the elements in the sequence.
- TKey
The type of the keys in the resulting dictionary.
- TValue
The type of the values in the resulting dictionary.
Show: