ResDoIfErr(ActionString) Method
Runs
action(error-message) only if IsErr; and returns itself back.
This is the counterpart of the
Do(Action) method.
Res result = RefreshIndices(/*inputs*/).DoIfErr(err => Alert($"database connection failed: {err}"));
// result will be:
// - Ok if refreshing db indices succeeded;
// - Err if it failed, in which case the Alert call will be made.
Namespace: Orx.Fun.ResultAssembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
public Res DoIfErr(
Action<string> action
)
- action ActionString
- Action to be executed only if this IsErr.
Res