Method Where
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
Where<T>(Task<Maybe<T>>, Func<T, bool>)
Keeps the value the task will give only if it satisfies a predicate.
public static Task<Maybe<T>> Where<T>(this Task<Maybe<T>> a, Func<T, bool> predicate)
Parameters
aTask<Maybe<T>>The task giving the value to filter.
predicateFunc<T, bool>Run with the contained value when there is one.
Returns
- Task<Maybe<T>>
A task giving the awaited value if it contained one which satisfied
predicate, and a Maybe<T> containing no value otherwise.
Type Parameters
TThe type of the value, when there is one.