OptTMatchTOut(FuncT, TOut, TOut) Method
Maps into
whenSome(Unwrap()) whenever IsSome; and into
whenNone otherwise.
Opt<User> user = GetOptionalUser(..);
string greeting = user.Match(u => $"Welcome back {u.Name}", "Hello");
greeting = user.Match(whenSome: u => $"Welcome back {u.Name}", whenNone: "Hello");
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public TOut Match<TOut>(
Func<T, TOut> whenSome,
TOut whenNone
)
- whenSome FuncT, TOut
- Mapping function (T -> TOut) that will be called with Unwrapped value to get the return value when Some.
- whenNone TOut
- Return value when None.
- TOut
[Missing <typeparam name="TOut"/> documentation for "M:Orx.Fun.Option.Opt`1.Match``1(System.Func{`0,``0},``0)"]
TOut