ResDoIfErr(Action) Method

Runs action() only if IsErr; and returns itself back. This is the counterpart of the Do(Action) method.
C#
Res result = RefreshIndices(/*inputs*/).DoIfErr(() => Alert("database connection failed"));
// result will be:
// - Ok if refreshing db indices succeeded;
// - Err if it failed, in which case the Alert call will be made.

Definition

Namespace: Orx.Fun.Result
Assembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
C#
public Res DoIfErr(
	Action action
)

Parameters

action  Action
Action to be executed only if this IsErr.

Return Value

Res

See Also