Table of Contents

Class TapExtensionsAsync

Namespace
FunctionalDdd
Assembly
FunctionalDdd.RailwayOrientedProgramming.dll

Provides asynchronous extension methods for executing side effects on successful Results without changing the Result.

public static class TapExtensionsAsync
Inheritance
TapExtensionsAsync
Inherited Members

Methods

TapAsync<TValue>(Result<TValue>, Func<Task>)

Asynchronously executes the given async action if the result is a success. Returns the original result unchanged.

public static Task<Result<TValue>> TapAsync<TValue>(this Result<TValue> result, Func<Task> func)

Parameters

result Result<TValue>

The result to tap.

func Func<Task>

The async action to execute if the result is successful.

Returns

Task<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(Result<TValue>, Func<ValueTask>)

Asynchronously executes the given async action if the result is a success. Returns the original result unchanged.

public static ValueTask<Result<TValue>> TapAsync<TValue>(this Result<TValue> result, Func<ValueTask> func)

Parameters

result Result<TValue>

The result to tap.

func Func<ValueTask>

The async action to execute if the result is successful.

Returns

ValueTask<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(Result<TValue>, Func<TValue, Task>)

Asynchronously executes the given async action with the value if the result is a success. Returns the original result unchanged.

public static Task<Result<TValue>> TapAsync<TValue>(this Result<TValue> result, Func<TValue, Task> func)

Parameters

result Result<TValue>

The result to tap.

func Func<TValue, Task>

The async action to execute with the value if the result is successful.

Returns

Task<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(Result<TValue>, Func<TValue, ValueTask>)

Asynchronously executes the given async action with the value if the result is a success. Returns the original result unchanged.

public static ValueTask<Result<TValue>> TapAsync<TValue>(this Result<TValue> result, Func<TValue, ValueTask> func)

Parameters

result Result<TValue>

The result to tap.

func Func<TValue, ValueTask>

The async action to execute with the value if the result is successful.

Returns

ValueTask<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(Task<Result<TValue>>, Action)

Asynchronously executes the given action if the result is a success. Returns the original result unchanged.

public static Task<Result<TValue>> TapAsync<TValue>(this Task<Result<TValue>> resultTask, Action action)

Parameters

resultTask Task<Result<TValue>>

The task containing the result to tap.

action Action

The action to execute if the result is successful.

Returns

Task<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(Task<Result<TValue>>, Action<TValue>)

Asynchronously executes the given action with the value if the result is a success. Returns the original result unchanged.

public static Task<Result<TValue>> TapAsync<TValue>(this Task<Result<TValue>> resultTask, Action<TValue> action)

Parameters

resultTask Task<Result<TValue>>

The task containing the result to tap.

action Action<TValue>

The action to execute with the value if the result is successful.

Returns

Task<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(Task<Result<TValue>>, Func<Task>)

Asynchronously executes the given async action if the result is a success. Returns the original result unchanged.

public static Task<Result<TValue>> TapAsync<TValue>(this Task<Result<TValue>> resultTask, Func<Task> func)

Parameters

resultTask Task<Result<TValue>>

The task containing the result to tap.

func Func<Task>

The async action to execute if the result is successful.

Returns

Task<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(Task<Result<TValue>>, Func<TValue, Task>)

Asynchronously executes the given async action with the value if the result is a success. Returns the original result unchanged.

public static Task<Result<TValue>> TapAsync<TValue>(this Task<Result<TValue>> resultTask, Func<TValue, Task> func)

Parameters

resultTask Task<Result<TValue>>

The task containing the result to tap.

func Func<TValue, Task>

The async action to execute with the value if the result is successful.

Returns

Task<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(ValueTask<Result<TValue>>, Action)

Asynchronously executes the given action if the result is a success. Returns the original result unchanged.

public static ValueTask<Result<TValue>> TapAsync<TValue>(this ValueTask<Result<TValue>> resultTask, Action action)

Parameters

resultTask ValueTask<Result<TValue>>

The ValueTask containing the result to tap.

action Action

The action to execute if the result is successful.

Returns

ValueTask<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(ValueTask<Result<TValue>>, Action<TValue>)

Asynchronously executes the given action with the value if the result is a success. Returns the original result unchanged.

public static ValueTask<Result<TValue>> TapAsync<TValue>(this ValueTask<Result<TValue>> resultTask, Action<TValue> action)

Parameters

resultTask ValueTask<Result<TValue>>

The ValueTask containing the result to tap.

action Action<TValue>

The action to execute with the value if the result is successful.

Returns

ValueTask<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(ValueTask<Result<TValue>>, Func<ValueTask>)

Asynchronously executes the given async action if the result is a success. Returns the original result unchanged.

public static ValueTask<Result<TValue>> TapAsync<TValue>(this ValueTask<Result<TValue>> resultTask, Func<ValueTask> valueTask)

Parameters

resultTask ValueTask<Result<TValue>>

The ValueTask containing the result to tap.

valueTask Func<ValueTask>

The async action to execute if the result is successful.

Returns

ValueTask<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.

TapAsync<TValue>(ValueTask<Result<TValue>>, Func<TValue, ValueTask>)

Asynchronously executes the given async action with the value if the result is a success. Returns the original result unchanged.

public static ValueTask<Result<TValue>> TapAsync<TValue>(this ValueTask<Result<TValue>> resultTask, Func<TValue, ValueTask> valueTask)

Parameters

resultTask ValueTask<Result<TValue>>

The ValueTask containing the result to tap.

valueTask Func<TValue, ValueTask>

The async action to execute with the value if the result is successful.

Returns

ValueTask<Result<TValue>>

The original result unchanged.

Type Parameters

TValue

Type of the result value.