Sql​Azure​Execution​Strategy Sql​Azure​Execution​Strategy Class

Definition

public class SqlAzureExecutionStrategy : ExecutionStrategy, IExecutionStrategyPublic Class SqlAzureExecutionStrategy
    Inherits ExecutionStrategy
    Implements IExecutionStrategy
Inheritance
System.ObjectSystem.Object
SqlAzureExecutionStrategySqlAzureExecutionStrategy
Implements

Inherited Members

Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy

Execute<TState, TResult>(System.Func<TState, TResult>, TState)Execute(Of TState, TResult)(System.Func(Of TState, TResult), TState)
ExecuteAsync<TState, TResult>(System.Func<TState, System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult>>, TState, System.Threading.CancellationToken)ExecuteAsync(Of TState, TResult)(System.Func(Of TState, System.Threading.CancellationToken, System.Threading.Tasks.Task(Of TResult)), TState, System.Threading.CancellationToken)
GetNextDelay(System.Exception)GetNextDelay(System.Exception)
UnwrapAndHandleException<T>(System.Exception, System.Func<System.Exception, T>)UnwrapAndHandleException(Of T)(System.Exception, System.Func(Of System.Exception, T))

System.Object

System.Object.ToString()System.Object.ToString()
System.Object.Equals(System.Object)System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()System.Object.GetHashCode()
System.Object.GetType()System.Object.GetType()
System.Object.MemberwiseClone()System.Object.MemberwiseClone()

Constructors

SqlAzureExecutionStrategy() SqlAzureExecutionStrategy()

Creates a new instance of SqlAzureExecutionStrategy without a context.

protected SqlAzureExecutionStrategy()Protected Sub New

Remarks

The default retry limit is 5, which means that the total amount of time spent before failing is 26 seconds plus the random factor.

SqlAzureExecutionStrategy(DbContext) SqlAzureExecutionStrategy(DbContext)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(DbContext context)Public Sub New(context As DbContext)
Parameters
context
DbContext DbContext

The context on which the operations will be invoked.

Remarks

The default retry limit is 5, which means that the total amount of time spent before failing is 26 seconds plus the random factor.

SqlAzureExecutionStrategy(DbContext, Int32) SqlAzureExecutionStrategy(DbContext, Int32)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(DbContext context, int maxRetryCount)Public Sub New(context As DbContext, maxRetryCount As Integer)
Parameters
context
DbContext DbContext

The context on which the operations will be invoked.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

SqlAzureExecutionStrategy(DbContext, Int32, TimeSpan, ICollection<Int32>) SqlAzureExecutionStrategy(DbContext, Int32, TimeSpan, ICollection(Of Int32))

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(DbContext context, int maxRetryCount, TimeSpan maxRetryDelay, ICollection<int> errorNumbersToAdd)Public Sub New(context As DbContext, maxRetryCount As Integer, maxRetryDelay As TimeSpan, errorNumbersToAdd As ICollection(Of Integer))
Parameters
context
DbContext DbContext

The context on which the operations will be invoked.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

maxRetryDelay
System.TimeSpan System.TimeSpan

The maximum delay in milliseconds between retries.

errorNumbersToAdd
System.Collections.Generic.ICollection<System.Int32> System.Collections.Generic.ICollection(Of System.Int32)

Additional SQL error numbers that should be considered transient.

SqlAzureExecutionStrategy(ExecutionStrategyContext) SqlAzureExecutionStrategy(ExecutionStrategyContext)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(ExecutionStrategyContext context)Public Sub New(context As ExecutionStrategyContext)
Parameters
context
ExecutionStrategyContext ExecutionStrategyContext

The required dependencies.

SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32) SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32)

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(ExecutionStrategyContext context, int maxRetryCount)Public Sub New(context As ExecutionStrategyContext, maxRetryCount As Integer)
Parameters
context
ExecutionStrategyContext ExecutionStrategyContext

The required dependencies.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32, TimeSpan, ICollection<Int32>) SqlAzureExecutionStrategy(ExecutionStrategyContext, Int32, TimeSpan, ICollection(Of Int32))

Creates a new instance of SqlAzureExecutionStrategy.

public SqlAzureExecutionStrategy(ExecutionStrategyContext context, int maxRetryCount, TimeSpan maxRetryDelay, ICollection<int> errorNumbersToAdd)Public Sub New(context As ExecutionStrategyContext, maxRetryCount As Integer, maxRetryDelay As TimeSpan, errorNumbersToAdd As ICollection(Of Integer))
Parameters
context
ExecutionStrategyContext ExecutionStrategyContext

The required dependencies.

maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

maxRetryDelay
System.TimeSpan System.TimeSpan

The maximum delay in milliseconds between retries.

errorNumbersToAdd
System.Collections.Generic.ICollection<System.Int32> System.Collections.Generic.ICollection(Of System.Int32)

Additional SQL error numbers that should be considered transient.

SqlAzureExecutionStrategy(Int32) SqlAzureExecutionStrategy(Int32)

Creates a new instance of SqlAzureExecutionStrategy without a context.

protected SqlAzureExecutionStrategy(int maxRetryCount)Protected Sub New(maxRetryCount As Integer)
Parameters
maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

SqlAzureExecutionStrategy(Int32, TimeSpan, ICollection<Int32>) SqlAzureExecutionStrategy(Int32, TimeSpan, ICollection(Of Int32))

Creates a new instance of SqlAzureExecutionStrategy without a context.

protected SqlAzureExecutionStrategy(int maxRetryCount, TimeSpan maxRetryDelay, ICollection<int> errorNumbersToAdd)Protected Sub New(maxRetryCount As Integer, maxRetryDelay As TimeSpan, errorNumbersToAdd As ICollection(Of Integer))
Parameters
maxRetryCount
System.Int32 System.Int32

The maximum number of retry attempts.

maxRetryDelay
System.TimeSpan System.TimeSpan

The maximum delay in milliseconds between retries.

errorNumbersToAdd
System.Collections.Generic.ICollection<System.Int32> System.Collections.Generic.ICollection(Of System.Int32)

Additional SQL error numbers that should be considered transient.

Methods

ShouldRetryOn(Exception) ShouldRetryOn(Exception)

protected override bool ShouldRetryOn(Exception exception)Protected Overrides Function ShouldRetryOn(exception As Exception) As Boolean
Parameters
exception
System.Exception System.Exception
Returns
System.Boolean System.Boolean
Overrides