ImmutableArrayExtensions::ToDictionary<TKey, TElement, T> Method (ImmutableArray<T>, Func<T, TKey>^, Func<T, TElement>^, IEqualityComparer<TKey>^)

 

Creates a dictionary based on the contents of this array.

Namespace:   System.Linq
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public:
generic<typename TKey, typename TElement, typename T>
[ExtensionAttribute]
static Dictionary<TKey, TElement>^ ToDictionary(
	ImmutableArray<T> immutableArray,
	Func<T, TKey>^ keySelector,
	Func<T, TElement>^ elementSelector,
	IEqualityComparer<TKey>^ comparer
)

Parameters

immutableArray
Type: System.Collections.Immutable::ImmutableArray<T>

The array to create a dictionary from.

keySelector
Type: System::Func<T, TKey>^

The key selector.

elementSelector
Type: System::Func<T, TElement>^

The element selector.

comparer
Type: System.Collections.Generic::IEqualityComparer<TKey>^

The comparer to initialize the dictionary with.

Return Value

Type: System.Collections.Generic::Dictionary<TKey, TElement>^

The newly initialized dictionary.

Type Parameters

TKey

The type of the key.

TElement

The type of the element.

T

The type of element contained by the collection.

Return to top
Show: