Class BindZipExtensionsAsync
- Namespace
- Trellis
- Assembly
- Trellis.Results.dll
Async BindZip extensions where both input and function are async (Task).
public static class BindZipExtensionsAsync
- Inheritance
-
BindZipExtensionsAsync
- Inherited Members
Methods
BindZipAsync<T1, T2>(Task<Result<T1>>, Func<T1, Task<Result<T2>>>)
Asynchronously binds an async function to the awaited Result value and zips both values into a tuple.
public static Task<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Task<Result<T1>> resultTask, Func<T1, Task<Result<T2>>> func)
Parameters
resultTaskTask<Result<T1>>The task containing the result to bind and zip.
funcFunc<T1, Task<Result<T2>>>The async function to call if the result is successful.
Returns
Type Parameters
T1Type of the input result value.
T2Type of the new result value.
BindZipAsync<T1, T2>(Task<Result<T1>>, Func<T1, Result<T2>>)
Asynchronously binds a function to the awaited Result value and zips both values into a tuple.
public static Task<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Task<Result<T1>> resultTask, Func<T1, Result<T2>> func)
Parameters
resultTaskTask<Result<T1>>The task containing the result to bind and zip.
funcFunc<T1, Result<T2>>The synchronous function to call if the result is successful.
Returns
Type Parameters
T1Type of the input result value.
T2Type of the new result value.
BindZipAsync<T1, T2>(ValueTask<Result<T1>>, Func<T1, ValueTask<Result<T2>>>)
Binds an async function to the awaited ValueTask Result value and zips both values into a tuple.
public static ValueTask<Result<(T1, T2)>> BindZipAsync<T1, T2>(this ValueTask<Result<T1>> resultTask, Func<T1, ValueTask<Result<T2>>> func)
Parameters
resultTaskValueTask<Result<T1>>The ValueTask containing the result to bind and zip.
funcFunc<T1, ValueTask<Result<T2>>>The async function to call if the result is successful.
Returns
- ValueTask<Result<(T1, T2)>>
A ValueTask tuple result combining both values on success; otherwise the failure.
Type Parameters
T1Type of the input result value.
T2Type of the new result value.
BindZipAsync<T1, T2>(ValueTask<Result<T1>>, Func<T1, Result<T2>>)
Binds a synchronous function to the awaited ValueTask Result value and zips both values into a tuple.
public static ValueTask<Result<(T1, T2)>> BindZipAsync<T1, T2>(this ValueTask<Result<T1>> resultTask, Func<T1, Result<T2>> func)
Parameters
resultTaskValueTask<Result<T1>>The ValueTask containing the result to bind and zip.
funcFunc<T1, Result<T2>>The synchronous function to call if the result is successful.
Returns
Type Parameters
T1Type of the input result value.
T2Type of the new result value.
BindZipAsync<T1, T2>(Result<T1>, Func<T1, Task<Result<T2>>>)
Binds an async function to the Result value and zips both values into a tuple.
public static Task<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Result<T1> result, Func<T1, Task<Result<T2>>> func)
Parameters
resultResult<T1>The result to bind and zip.
funcFunc<T1, Task<Result<T2>>>The async function to call if the result is successful.
Returns
Type Parameters
T1Type of the input result value.
T2Type of the new result value.
BindZipAsync<T1, T2>(Result<T1>, Func<T1, ValueTask<Result<T2>>>)
Binds an async function to the Result value and zips both values into a tuple (ValueTask variant).
public static ValueTask<Result<(T1, T2)>> BindZipAsync<T1, T2>(this Result<T1> result, Func<T1, ValueTask<Result<T2>>> func)
Parameters
resultResult<T1>The result to bind and zip.
funcFunc<T1, ValueTask<Result<T2>>>The async function to call if the result is successful.
Returns
- ValueTask<Result<(T1, T2)>>
A ValueTask tuple result combining both values on success; otherwise the failure.
Type Parameters
T1Type of the input result value.
T2Type of the new result value.