Method ExecuteAsync
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ExecuteAsync(Func<TCommand, ValueTask>)
Asynchronously creates a command of type TCommand and passes it to handler.
public virtual ValueTask ExecuteAsync(Func<TCommand, ValueTask> handler)
Parameters
Returns
- ValueTask
A task that completes after
handlerhas completed and the connection has been released.
Remarks
Implementations that expose a cancellation token throw OperationCanceledException if it is already canceled when this method is called.
ExecuteAsync<T>(Func<TCommand, ValueTask<T>>)
Asynchronously creates a command of type TCommand and passes it to transform, returning its result.
public virtual ValueTask<T> ExecuteAsync<T>(Func<TCommand, ValueTask<T>> transform)
Parameters
Returns
- ValueTask<T>
A task that produces the value returned by
transformafter the connection has been released.
Type Parameters
TThe return type of the transform function.
Remarks
Implementations that expose a cancellation token throw OperationCanceledException if it is already canceled when this method is called.