Table of Contents

Method Execute

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

Execute<TCommand>(IExecuteCommand<TCommand>, Action<TCommand>)

Executes the command and passes it to the handler.

public static void Execute<TCommand>(this IExecuteCommand<TCommand> command, Action<TCommand> action) where TCommand : IDbCommand

Parameters

command IExecuteCommand<TCommand>

The command to execute.

action Action<TCommand>

The function that uses the command.

Type Parameters

TCommand

The type of command.

Exceptions

ArgumentNullException

action is null.

Execute<TCommand, T>(IExecuteCommand<TCommand>, Func<TCommand, T>)

Executes the command, passes it to the transform and returns the result.

public static T Execute<TCommand, T>(this IExecuteCommand<TCommand> command, Func<TCommand, T> transform) where TCommand : IDbCommand

Parameters

command IExecuteCommand<TCommand>

The command to execute.

transform Func<TCommand, T>

The function that uses the command.

Returns

T

The value returned from the transform.

Type Parameters

TCommand

The type of command.

T

The type returned.

Exceptions

ArgumentNullException

transform is null.

Execute(IExecuteCommand, Action<IDbCommand>)

Executes the command and passes it to the handler.

public static void Execute(this IExecuteCommand command, Action<IDbCommand> action)

Parameters

command IExecuteCommand

The command to execute.

action Action<IDbCommand>

The function that uses the command.

Exceptions

ArgumentNullException

command or action is null.

NotSupportedException

The command does not support blocking calls; use the async call.

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

Executes the command, passes it to the transform and returns the result.

public static T Execute<T>(this IExecuteCommand command, Func<IDbCommand, T> transform)

Parameters

command IExecuteCommand

The command to execute.

transform Func<IDbCommand, T>

The function that uses the command.

Returns

T

The value returned from the transform.

Type Parameters

T

The type returned.

Exceptions

ArgumentNullException

command or transform is null.

NotSupportedException

The command does not support blocking calls; use the async call.