Table of Contents

Method ValueOr

Namespace
SodaFlow.Functional
Assembly
SodaFlow.Functional.dll

ValueOr<T>(Task<Maybe<T>>, T)

Returns the value the task gives if there is one, and the given value otherwise.

public static Task<T> ValueOr<T>(this Task<Maybe<T>> a, T defaultValue)

Parameters

a Task<Maybe<T>>

The task giving the value to read.

defaultValue T

Returned when the awaited value contains none.

Returns

Task<T>

A task giving the contained value, or defaultValue .

Type Parameters

T

The type of the value, when there is one.