OptTThrowIfNoneE(FuncE) Method
Returns the option back when
IsSome; throws a custom exception when
IsNone.
Exception thrown when IsNone is created by the provided method
getException.
Can be called without breaking the flow of chained operations.
var interestRate = GetOptionalUser(input)
.ThrowIfNone(() => new ArithmeticException("sth went wrong"))
.Map(user => ComputeInterestRate(user))
.Unwrap();
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public Opt<T> ThrowIfNone<E>(
Func<E> getException
)
where E : Exception
- getException FuncE
- Method to be called to create the exception if the option is of None variant.
- E
[Missing <typeparam name="E"/> documentation for "M:Orx.Fun.Option.Opt`1.ThrowIfNone``1(System.Func{``0})"]
OptT