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
commandIExecuteCommand<TCommand>The command to execute.
actionAction<TCommand>The function that uses the command.
Type Parameters
TCommandThe type of command.
Exceptions
- ArgumentNullException
actionis 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
commandIExecuteCommand<TCommand>The command to execute.
transformFunc<TCommand, T>The function that uses the command.
Returns
- T
The value returned from the transform.
Type Parameters
TCommandThe type of command.
TThe type returned.
Exceptions
- ArgumentNullException
transformis 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
commandIExecuteCommandThe command to execute.
actionAction<IDbCommand>The function that uses the command.
Exceptions
- ArgumentNullException
commandoractionis 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
commandIExecuteCommandThe command to execute.
transformFunc<IDbCommand, T>The function that uses the command.
Returns
- T
The value returned from the transform.
Type Parameters
TThe type returned.
Exceptions
- ArgumentNullException
commandortransformis null.- NotSupportedException
The command does not support blocking calls; use the async call.