OptTDoIfNone Method
Runs
actionOnNone() only if IsNone; and returns itself back.
Counterpart of
Do(ActionT) for the None variant.
// the logging call will only be made if the result of GetOptionalUser is None.
// Since DoIfNone returns back the option, it can still be assigned to var 'user'.
Opt<User> user = GetOptionalUser().DoIfNone(() => Log.Warning("User could not be read"));
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public Opt<T> DoIfNone(
Action actionOnNone
)
- actionOnNone Action
- Action that will be called when None.
OptT