ResTAnd(FuncRes) Method
Combines two results: this and
other as follows:
- returns this if both are Ok;
- returns the error if one of the results is an Err;
- returns the combined error if both results are Err.
var combined = Ok(12).And(Ok());
Assert.Equal(Ok(12), combined);
combined = Ok(12).And(Err("failure"));
Assert.True(combined.IsErr);
combined = Err<int>("error").And(Ok());
Assert.True(combined.IsErr);
combined = Err<int>("error").And(Err("failure"));
Assert.True(combined.IsErr);
Namespace: Orx.Fun.ResultAssembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
public Res<T> And(
Func<Res> lazyOther
)
- lazyOther FuncRes
- Other result to combine with; lazily evaluated only if this is Ok.
ResT