Microsoft.Data.SqlClient.SqlRetryLogicBaseProvider
Applies retry logic on an operation through the Execute<T> or ExecuteAsync<T> function.
Occurs before applying the calculated delay time and executing the function on a next attempt.
Defines the retry logic used to decide when to retry based on the encountered exception.
protected SqlRetryLogicBaseProvider()
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.
public abstract Task ExecuteAsync(object sender, Func<Task> function, CancellationToken cancellationToken = default)
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.
public abstract Task<TResult> ExecuteAsync<TResult>(object sender, Func<Task<TResult>> function, CancellationToken cancellationToken = default)
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.