OptTUnwrap Method

Returns the underlying value when IsSome; or throws when IsNone. Must be called shyly, as it is not necessary to unwrap until the final result is achieved due to Map, FlatMap and TryMap methods.
C#
Opt<int> optAge = "42".ParseIntOrNone();
if (optAge.IsSome) {
    int age = optAge.Unwrap(); // use the uwrapped age
} else { // handle the None case
}

Definition

Namespace: Orx.Fun.Option
Assembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
C#
public T Unwrap()

Return Value

T

See Also