ResTThrowIfErr Method

Returns the result back when IsOk; throws a NullReferenceException when IsErr.
C#
static Res<User> QueryUser(..) {
    // might fail; hence, returns a Res<User> rather than just User.
}
var result = QueryUser(..).ThrowIfErr();
// result will be:
// - Ok(user) if QueryUser succeeds and returns Ok of the user;
// - the application will throw otherwise.

Definition

Namespace: Orx.Fun.Result
Assembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
C#
public Res<T> ThrowIfErr()

Return Value

ResT

See Also