Table of Contents

Method ValueOnly

Namespace
GuildWars2
Assembly
GW2SDK.dll

ValueOnly<T>(Task<(T, MessageContext)>)

Returns a new task that only returns the value of the original task, discarding the message context.

public static Task<T> ValueOnly<T>(this Task<(T, MessageContext)> task)

Parameters

task Task<(T, MessageContext)>

The original task, which returns a tuple of the value and also the message context.

Returns

Task<T>

A new task that returns only the value.

Type Parameters

T

The type of the value returned by the original task.

ValueOnly<T>(IAsyncEnumerable<(T, MessageContext)>, CancellationToken)

Returns a new IAsyncEnumerable that only returns the value of the original IAsyncEnumerable, discarding the message context.

public static IAsyncEnumerable<T> ValueOnly<T>(this IAsyncEnumerable<(T, MessageContext)> source, CancellationToken cancellationToken = default)

Parameters

source IAsyncEnumerable<(T, MessageContext)>

The original IAsyncEnumerable, which returns a tuple of the value and also the message context.

cancellationToken CancellationToken

A token to cancel the enumeration.

Returns

IAsyncEnumerable<T>

A new IAsyncEnumerable that returns only the value.

Type Parameters

T

The type of the value returned by the original IAsyncEnumerable.