Table of Contents

Method ValueOrDefault

Namespace
SodaFlow.Functional
Assembly
SodaFlow.Functional.dll

ValueOrDefault<T>(Task<Maybe<T>>)

Returns the value the task gives if there is one, and the default for its type otherwise.

public static Task<T?> ValueOrDefault<T>(this Task<Maybe<T>> a)

Parameters

a Task<Maybe<T>>

The task giving the value to read.

Returns

Task<T>

A task giving the contained value, or default if there is none.

Type Parameters

T

The type of the value, when there is one.

Remarks

Carries the caveat on ValueOrDefault<T>(Maybe<T>): for a type whose default is itself a legitimate value, the answer cannot say which case it got.