Optional
Various extension and factory methods for constructing optional value.
Returns the second value if the first is empty.
public static Task<Optional<TOutput>> Convert<TInput, TOutput>(this Task<Optional<TInput>> task, Converter<TInput, TOutput> converter)
If a value is present, apply the provided mapping function to it, and if the result is
non-null, return an Optional describing the result. Otherwise returns Empty.
Returns the underlying type argument of the specified optional type.
If a value is present, and the value matches the given predicate,
return an Optional describing the value, otherwise return an empty Optional.
Indicates that specified type is optional type.
Returns the value if present; otherwise return default value.
If a value is present, returns the value, otherwise return default value.
Returns the value if present; otherwise invoke delegate.
If a value is present, returns the value, otherwise null.
If a value is present, returns the value, otherwise null.
public static Task<T> OrThrow<T, TException>(this Task<Optional<T>> task) where TException : Exception
If a value is present, returns the value, otherwise throw exception.
public static Task<T> OrThrow<T, TException>(this Task<Optional<T>> task, Func<TException> exceptionFactory) where TException : Exception
If a value is present, returns the value, otherwise throw exception.
Constructs optional value from nullable reference type.