Table of Contents

ExecuteCommand Method

Definition

Namespace
Cuemon.Data.SqlClient
Assemblies
Cuemon.Data.SqlClient.dll
Source
src/Cuemon.Data.SqlClient/SqlDataManager.cs

ExecuteCommand<T>(DataStatement, Func<IDbCommand, T>)

Core method for executing methods on the DbCommand object resolved from the virtual execute command workflow on DataManager.

protected override T ExecuteCommand<T>(DataStatement statement, Func<IDbCommand, T> executeSelector)

Parameters

statement DataStatement

The command statement to execute.

executeSelector Func<IDbCommand, T>

The function delegate that will invoke a method on the resolved DbCommand object.

Returns

T

A value of T that is equal to the invoked method of the DbCommand object.

Type Parameters

T

The type to return.

Remarks

If TransientFaultHandlingOptionsCallback is null, no SQL operation is wrapped inside a transient fault handling operation. Otherwise, if TransientFaultHandlingOptionsCallback has the EnableRecovery set to true, this method will, with it's default implementation, try to gracefully recover from transient faults when the following condition is met:
RetryAttempts is less than the current attempt starting from 1 with a maximum of MaxValue retries
DetectionStrategy must evaluate to true
In case of a transient failure the default implementation will use RetryStrategy.
In any other case the originating exception is thrown.