OptTDo Method
Runs
action(Unwrap()) only if IsSome; and returns itself back.
// the logging call will only be made if the result of GetOptionalUser is Some of a user.
// Since Do returns back the option, it can still be assigned to var 'user'.
Opt<User> user = GetOptionalUser().Do(u => Log.Info($"User '{u.Name}' grabbed"));
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public Opt<T> Do(
Action<T> action
)
- action ActionT
- Action that will be called with the underlying value when Some.
OptT