SqlRetryLogicBaseProvider Class

Definition

Applies retry logic on an operation through the Execute or ExecuteAsync function.

C#
public abstract class SqlRetryLogicBaseProvider
Inheritance
SqlRetryLogicBaseProvider

Constructors

Properties

Retrying

Occurs before applying the calculated delay time and executing the function on a next attempt.

RetryLogic

Defines the retry logic used to decide when to retry based on the encountered exception.

Methods

Execute<TResult>(Object, Func<TResult>)

Executes a function and applies retry logic, if enabled. Note: Exceptions will be reported via an aggregate exception if the execution isn't successful via retry attempts.

ExecuteAsync(Object, Func<Task>, CancellationToken)

Executes a function and applies retry logic, if enabled. The cancellation token can be used to request that the operation be abandoned before the execution attempts are exceeded. Note: Exceptions will be reported via the returned Task object, which will contain an aggregate exception if execution fails for all retry attempts.

ExecuteAsync<TResult>(Object, Func<Task<TResult>>, CancellationToken)

Executes a function and applies retry logic, if enabled. The cancellation token can be used to request that the operation be abandoned before the execution attempts are exceeded. Note: Exceptions will be reported via the returned Task object, which will contain an aggregate exception if execution fails for all retry attempts.

Applies to

Product Versions
SqlClient .NET Core 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Framework 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Standard 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2