Table of Contents

Class ResultLinqExtensionsTaskRightAsync

Namespace
Trellis
Assembly
Trellis.Core.dll

Async LINQ SelectMany overload where the source is a synchronous Result<TValue> and the collection selector returns a Task<TResult> of Result<TValue>.

public static class ResultLinqExtensionsTaskRightAsync
Inheritance
ResultLinqExtensionsTaskRightAsync
Inherited Members

Methods

SelectMany<TSource, TCollection, TResult>(Result<TSource>, Func<TSource, Task<Result<TCollection>>>, Func<TSource, TCollection, TResult>)

Projects a synchronous Result<TValue> through an async collection selector (LINQ SelectMany: sync source / async continuation).

public static Task<Result<TResult>> SelectMany<TSource, TCollection, TResult>(this Result<TSource> source, Func<TSource, Task<Result<TCollection>>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)

Parameters

source Result<TSource>

The synchronous source result.

collectionSelector Func<TSource, Task<Result<TCollection>>>

An async function returning the intermediate result.

resultSelector Func<TSource, TCollection, TResult>

A synchronous function combining the source and intermediate values.

Returns

Task<Result<TResult>>

A task producing the combined result, or the first failure encountered.

Type Parameters

TSource

Type of the source value.

TCollection

Type of the intermediate collection value.

TResult

Type of the final projected value.