Table of Contents

Method AsDictionary

Namespace
GuildWars2
Assembly
GW2SDK.dll

AsDictionary<TKey, TValue>(Task<(HashSet<TValue> Value, MessageContext Context)>, Func<TValue, TKey>)

Returns a new task that converts the HashSet<T> from the original task to a Dictionary<TKey, TValue>.

public static Task<(Dictionary<TKey, TValue> Value, MessageContext Context)> AsDictionary<TKey, TValue>(this Task<(HashSet<TValue> Value, MessageContext Context)> instance, Func<TValue, TKey> keySelector) where TKey : notnull

Parameters

instance Task<(HashSet<TValue> Value, MessageContext Context)>

The task.

keySelector Func<TValue, TKey>

The function to select the key from the value.

Returns

Task<(Dictionary<TKey, TValue> Value, MessageContext Context)>

A new task.

Type Parameters

TKey

The type of the key in the dictionary.

TValue

The type of the value in the dictionary.