OptTThrowIfNone Method

Returns the option back when IsSome; throws a NullReferenceException when IsNone. Can be called without breaking the flow of chained operations.
C#
var interestRate = GetOptionalUser(input)
    .ThrowIfNone("failed to get the user")
    .Map(user => ComputeInterestRate(user))
    .Unwrap();

Definition

Namespace: Orx.Fun.Option
Assembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
C#
public Opt<T> ThrowIfNone()

Return Value

OptT

See Also