Table of Contents

Class MaybeLinqExtensionsTaskRightAsync

Namespace
Trellis
Assembly
Trellis.Core.dll

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

public static class MaybeLinqExtensionsTaskRightAsync
Inheritance
MaybeLinqExtensionsTaskRightAsync
Inherited Members

Methods

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

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

public static Task<Maybe<TResult>> SelectMany<TSource, TCollection, TResult>(this Maybe<TSource> source, Func<TSource, Task<Maybe<TCollection>>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector) where TSource : notnull where TCollection : notnull where TResult : notnull

Parameters

source Maybe<TSource>

The synchronous source Maybe.

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

An async function returning the intermediate Maybe.

resultSelector Func<TSource, TCollection, TResult>

A synchronous function combining the source and intermediate values.

Returns

Task<Maybe<TResult>>

A task producing the combined Maybe, or None if any step has no value.

Type Parameters

TSource

Type of the source value.

TCollection

Type of the intermediate collection value.

TResult

Type of the final projected value.