ResultExtensionsMapT1, T2, TOut(ResValueTupleT1, T2, FuncT1, T2, TaskTOut) Method
(async version) Allows a result of a tuple (t1, t2) to map with a function taking two arguments t1 and t2.
static int Add(int a, int b) => a + b;
var numbers = Ok((1, 2));
var sum = numbers.Map(Add);
Assert(sum == Some(3));
This is mostly useful in enabling function composition.
Namespace: Orx.Fun.ResultAssembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
public static Task<Res<TOut>> Map<T1, T2, TOut>(
this Res<(T1 , T2 )> result,
Func<T1, T2, Task<TOut>> map
)
- result ResValueTupleT1, T2
- Result to be mapped.
- map FuncT1, T2, TaskTOut
- Map function.
- T1
- Type of the first argument of the map function.
- T2
- Type of the second argument of the map function.
- TOut
- Type of return value of the map function.
TaskResTOutIn Visual Basic and C#, you can call this method as an instance method on any object of type
ResValueTupleT1,
T2. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).