Method ExecuteAsync
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ExecuteAsync(Func<IDbCommand, ValueTask>)
Asynchronously creates a command and passes it to handler.
ValueTask ExecuteAsync(Func<IDbCommand, ValueTask> handler)
Parameters
handlerFunc<IDbCommand, ValueTask>The asynchronous function that operates on the command.
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<IDbCommand, ValueTask<T>>)
Asynchronously creates a command and passes it to transform, returning its result.
ValueTask<T> ExecuteAsync<T>(Func<IDbCommand, ValueTask<T>> transform)
Parameters
transformFunc<IDbCommand, ValueTask<T>>The asynchronous function that operates on the command.
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.