Class BindExtensionsAsync
- Namespace
- FunctionalDdd
- Assembly
- FunctionalDdd.RailwayOrientedProgramming.dll
Provides asynchronous extension methods for binding (chaining) operations over Result values.
public static class BindExtensionsAsync
- Inheritance
-
BindExtensionsAsync
- Inherited Members
Methods
BindAsync<TValue, TResult>(Result<TValue>, Func<TValue, Task<Result<TResult>>>)
Asynchronously binds the result to a function that returns a new result.
public static Task<Result<TResult>> BindAsync<TValue, TResult>(this Result<TValue> result, Func<TValue, Task<Result<TResult>>> func)
Parameters
resultResult<TValue>The result to bind.
funcFunc<TValue, Task<Result<TResult>>>The async function to call if the result is successful.
Returns
Type Parameters
TValueType of the input result value.
TResultType of the output result value.
BindAsync<TValue, TResult>(Result<TValue>, Func<TValue, ValueTask<Result<TResult>>>)
Binds the result to an async function that returns a ValueTask result.
public static ValueTask<Result<TResult>> BindAsync<TValue, TResult>(this Result<TValue> result, Func<TValue, ValueTask<Result<TResult>>> valueTask)
Parameters
resultResult<TValue>The result to bind.
valueTaskFunc<TValue, ValueTask<Result<TResult>>>The async function to call if the result is successful.
Returns
- ValueTask<Result<TResult>>
A new result from the function if success; otherwise the original failure.
Type Parameters
TValueType of the input result value.
TResultType of the output result value.
BindAsync<TValue, TResult>(Task<Result<TValue>>, Func<TValue, Result<TResult>>)
Asynchronously binds a task result to a synchronous function that returns a new result.
public static Task<Result<TResult>> BindAsync<TValue, TResult>(this Task<Result<TValue>> resultTask, Func<TValue, Result<TResult>> func)
Parameters
resultTaskTask<Result<TValue>>The task containing the result to bind.
funcFunc<TValue, Result<TResult>>The function to call if the result is successful.
Returns
Type Parameters
TValueType of the input result value.
TResultType of the output result value.
BindAsync<TValue, TResult>(Task<Result<TValue>>, Func<TValue, Task<Result<TResult>>>)
Asynchronously binds a task result to a function that returns a new result.
public static Task<Result<TResult>> BindAsync<TValue, TResult>(this Task<Result<TValue>> resultTask, Func<TValue, Task<Result<TResult>>> func)
Parameters
resultTaskTask<Result<TValue>>The task containing the result to bind.
funcFunc<TValue, Task<Result<TResult>>>The async function to call if the result is successful.
Returns
Type Parameters
TValueType of the input result value.
TResultType of the output result value.
BindAsync<TValue, TResult>(ValueTask<Result<TValue>>, Func<TValue, Result<TResult>>)
Asynchronously binds a ValueTask result to a synchronous function that returns a new result.
public static ValueTask<Result<TResult>> BindAsync<TValue, TResult>(this ValueTask<Result<TValue>> resultTask, Func<TValue, Result<TResult>> func)
Parameters
resultTaskValueTask<Result<TValue>>The ValueTask containing the result to bind.
funcFunc<TValue, Result<TResult>>The function to call if the result is successful.
Returns
- ValueTask<Result<TResult>>
A new result from the function if success; otherwise the original failure.
Type Parameters
TValueType of the input result value.
TResultType of the output result value.
BindAsync<TValue, TResult>(ValueTask<Result<TValue>>, Func<TValue, ValueTask<Result<TResult>>>)
Asynchronously binds a ValueTask result to a function that returns a new result.
public static ValueTask<Result<TResult>> BindAsync<TValue, TResult>(this ValueTask<Result<TValue>> resultTask, Func<TValue, ValueTask<Result<TResult>>> valueTask)
Parameters
resultTaskValueTask<Result<TValue>>The ValueTask containing the result to bind.
valueTaskFunc<TValue, ValueTask<Result<TResult>>>The async function to call if the result is successful.
Returns
- ValueTask<Result<TResult>>
A new result from the function if success; otherwise the original failure.
Type Parameters
TValueType of the input result value.
TResultType of the output result value.