ResTDo Method
Runs
action(Unwrap()) only if IsOk; and returns itself back.
// the logging call will only be made if the result of TryGetUser is Ok of a user.
// Since Do returns back the result, it can still be assigned to var 'user'.
Res<User> user = TryGetUser().Do(u => Log.Info($"User '{u.Name}' grabbed"));
Namespace: Orx.Fun.ResultAssembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
public Res<T> Do(
Action<T> action
)
- action ActionT
- Action that will be called with the underlying value when Ok.
ResT