ResOr(Res) Method
Combines two results: this and
other as follows:
- returns this if this is Ok;
- returns other otherwise.
var or = Ok().Or(Ok());
Assert.True(or.IsOk);
or = Ok().Or(Err("error-message"));
Assert.True(or.IsOk);
or = Err("error-message").Or(Ok());
Assert.True(or.IsOk);
or = Err("error-message").Or(Err("second-error-message"));
Assert.True(or.IsErr);
Assert.Equal(Some("second-error-message"), or.ErrorMessage());
Namespace: Orx.Fun.ResultAssembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
public Res Or(
Res other
)
- other Res
- Other result to combine with.
Res