Table of Contents

Interface IExecuteCommand

Namespace
Open.Database.Extensions
Assembly
Open.Database.Extensions.Core.dll

Executes work against an IDbCommand that the implementation creates, runs, and cleans up for the caller.

public interface IExecuteCommand

Remarks

Each call takes a connection, opens it only if needed, creates the command (with its text, type, timeout, parameters, and transaction already applied), passes it to the supplied function, and then releases the connection. Anything provider related that the function throws propagates unchanged and the connection is still released. The command is disposed when the function returns, so do not keep it.

Methods

Execute(Action<IDbCommand>)

Creates a command and passes it to action.

ExecuteAsync(Func<IDbCommand, ValueTask>)

Asynchronously creates a command and passes it to handler.

ExecuteAsync<T>(Func<IDbCommand, ValueTask<T>>)

Asynchronously creates a command and passes it to transform, returning its result.

Execute<T>(Func<IDbCommand, T>)

Creates a command and passes it to transform, returning its result.

See Also