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
aTask<Maybe<T>>The task giving the value to read.
defaultValueTReturned when the awaited value contains none.
Returns
- Task<T>
A task giving the contained value, or
defaultValue.
Type Parameters
TThe type of the value, when there is one.