ExecutionStrategyExtensions ExecutionStrategyExtensions Class

Extension methods for IExecutionStrategy

Syntax

Declaration

public static class ExecutionStrategyExtensionsPublic Module ExecutionStrategyExtensions

Inheritance Hierarchy

  • System.Object
    System.Object
  • ExecutionStrategyExtensions
    ExecutionStrategyExtensions

Inherited Members

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

Methods summary

Executes the specified operation.

Executes the specified operation.

Executes the specified operation and returns the result.

Executes the specified asynchronous operation.

Executes the specified asynchronous operation.

Executes the specified asynchronous operation.

Executes the specified asynchronous operation.

Executes the specified asynchronous operation and returns the result.

Executes the specified asynchronous operation and returns the result.

Executes the specified asynchronous operation and returns the result.

Methods

  • Execute(IExecutionStrategy, Action)
    Execute(IExecutionStrategy, Action)

    Executes the specified operation.

    public static void Execute(this IExecutionStrategy strategy, Action operation)<ExtensionAttribute>
    Public Shared Sub Execute(strategy As IExecutionStrategy, operation As Action)

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Action
      System.Action

      A delegate representing an executable operation that doesn't return any results.

  • Execute<TState>(IExecutionStrategy, Action<TState>, TState)
    Execute(Of TState)(IExecutionStrategy, Action(Of TState), TState)

    Executes the specified operation.

    public static void Execute<TState>(this IExecutionStrategy strategy, Action<TState> operation, TState state)<ExtensionAttribute>
    Public Shared Sub Execute(Of TState)(strategy As IExecutionStrategy, operation As Action(Of TState), state As TState)

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Action<T><TState>
      System.Action<T>(Of TState)

      A delegate representing an executable operation that doesn't return any results.

    • state
      TState
      TState

      The state that will be passed to the operation.

  • Execute<TResult>(IExecutionStrategy, Func<TResult>)
    Execute(Of TResult)(IExecutionStrategy, Func(Of TResult))

    Executes the specified operation and returns the result.

    public static TResult Execute<TResult>(this IExecutionStrategy strategy, Func<TResult> operation)<ExtensionAttribute>
    Public Shared Function Execute(Of TResult)(strategy As IExecutionStrategy, operation As Func(Of TResult)) As TResult

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<TResult><TResult>
      System.Func<TResult>(Of TResult)

      A delegate representing an executable operation that returns the result of type TResult.

    Returns

    • TResult
      TResult

      The result from the operation.

  • ExecuteAsync(IExecutionStrategy, Func<CancellationToken, Task>, CancellationToken)
    ExecuteAsync(IExecutionStrategy, Func(Of CancellationToken, Task), CancellationToken)

    Executes the specified asynchronous operation.

    public static Task ExecuteAsync(this IExecutionStrategy strategy, Func<CancellationToken, Task> operation, CancellationToken cancellationToken)<ExtensionAttribute>
    Public Shared Function ExecuteAsync(strategy As IExecutionStrategy, operation As Func(Of CancellationToken, Task), cancellationToken As CancellationToken) As Task

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<T, TResult><System.Threading.CancellationToken, System.Threading.Tasks.Task>
      System.Func<T, TResult>(Of System.Threading.CancellationToken, System.Threading.Tasks.Task)

      A function that returns a started task.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task

      A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed.

  • ExecuteAsync(IExecutionStrategy, Func<Task>)
    ExecuteAsync(IExecutionStrategy, Func(Of Task))

    Executes the specified asynchronous operation.

    public static Task ExecuteAsync(this IExecutionStrategy strategy, Func<Task> operation)<ExtensionAttribute>
    Public Shared Function ExecuteAsync(strategy As IExecutionStrategy, operation As Func(Of Task)) As Task

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<TResult><System.Threading.Tasks.Task>
      System.Func<TResult>(Of System.Threading.Tasks.Task)

      A function that returns a started task.

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task

      A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed.

  • ExecuteAsync<TState>(IExecutionStrategy, Func<TState, CancellationToken, Task>, TState, CancellationToken)
    ExecuteAsync(Of TState)(IExecutionStrategy, Func(Of TState, CancellationToken, Task), TState, CancellationToken)

    Executes the specified asynchronous operation.

    public static Task ExecuteAsync<TState>(this IExecutionStrategy strategy, Func<TState, CancellationToken, Task> operation, TState state, CancellationToken cancellationToken)<ExtensionAttribute>
    Public Shared Function ExecuteAsync(Of TState)(strategy As IExecutionStrategy, operation As Func(Of TState, CancellationToken, Task), state As TState, cancellationToken As CancellationToken) As Task

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<T1, T2, TResult><TState, System.Threading.CancellationToken, System.Threading.Tasks.Task>
      System.Func<T1, T2, TResult>(Of TState, System.Threading.CancellationToken, System.Threading.Tasks.Task)

      A function that returns a started task.

    • state
      TState
      TState

      The state that will be passed to the operation.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task

      A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed.

  • ExecuteAsync<TState>(IExecutionStrategy, Func<TState, Task>, TState)
    ExecuteAsync(Of TState)(IExecutionStrategy, Func(Of TState, Task), TState)

    Executes the specified asynchronous operation.

    public static Task ExecuteAsync<TState>(this IExecutionStrategy strategy, Func<TState, Task> operation, TState state)<ExtensionAttribute>
    Public Shared Function ExecuteAsync(Of TState)(strategy As IExecutionStrategy, operation As Func(Of TState, Task), state As TState) As Task

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<T, TResult><TState, System.Threading.Tasks.Task>
      System.Func<T, TResult>(Of TState, System.Threading.Tasks.Task)

      A function that returns a started task.

    • state
      TState
      TState

      The state that will be passed to the operation.

    Returns

    • System.Threading.Tasks.Task
      System.Threading.Tasks.Task

      A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed.

  • ExecuteAsync<TResult>(IExecutionStrategy, Func<CancellationToken, Task<TResult>>, CancellationToken)
    ExecuteAsync(Of TResult)(IExecutionStrategy, Func(Of CancellationToken, Task(Of TResult)), CancellationToken)

    Executes the specified asynchronous operation and returns the result.

    public static Task<TResult> ExecuteAsync<TResult>(this IExecutionStrategy strategy, Func<CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken)<ExtensionAttribute>
    Public Shared Function ExecuteAsync(Of TResult)(strategy As IExecutionStrategy, operation As Func(Of CancellationToken, Task(Of TResult)), cancellationToken As CancellationToken) As Task(Of TResult)

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<T, TResult><System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult><TResult>>
      System.Func<T, TResult>(Of System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult>(Of TResult))

      A function that returns a started task of type TResult.

    • cancellationToken
      System.Threading.CancellationToken
      System.Threading.CancellationToken

      A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.

    Returns

    • System.Threading.Tasks.Task<TResult><TResult>
      System.Threading.Tasks.Task<TResult>(Of TResult)

      A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed.

  • ExecuteAsync<TResult>(IExecutionStrategy, Func<Task<TResult>>)
    ExecuteAsync(Of TResult)(IExecutionStrategy, Func(Of Task(Of TResult)))

    Executes the specified asynchronous operation and returns the result.

    public static Task<TResult> ExecuteAsync<TResult>(this IExecutionStrategy strategy, Func<Task<TResult>> operation)<ExtensionAttribute>
    Public Shared Function ExecuteAsync(Of TResult)(strategy As IExecutionStrategy, operation As Func(Of Task(Of TResult))) As Task(Of TResult)

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<TResult><System.Threading.Tasks.Task<TResult><TResult>>
      System.Func<TResult>(Of System.Threading.Tasks.Task<TResult>(Of TResult))

      A function that returns a started task of type TResult.

    Returns

    • System.Threading.Tasks.Task<TResult><TResult>
      System.Threading.Tasks.Task<TResult>(Of TResult)

      A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed.

  • ExecuteAsync<TState, TResult>(IExecutionStrategy, Func<TState, Task<TResult>>, TState)
    ExecuteAsync(Of TState, TResult)(IExecutionStrategy, Func(Of TState, Task(Of TResult)), TState)

    Executes the specified asynchronous operation and returns the result.

    public static Task<TResult> ExecuteAsync<TState, TResult>(this IExecutionStrategy strategy, Func<TState, Task<TResult>> operation, TState state)<ExtensionAttribute>
    Public Shared Function ExecuteAsync(Of TState, TResult)(strategy As IExecutionStrategy, operation As Func(Of TState, Task(Of TResult)), state As TState) As Task(Of TResult)

    Parameters

    • strategy

      The strategy that will be used for the execution.

    • operation
      System.Func<T, TResult><TState, System.Threading.Tasks.Task<TResult><TResult>>
      System.Func<T, TResult>(Of TState, System.Threading.Tasks.Task<TResult>(Of TResult))

      A function that returns a started task of type TResult.

    • state
      TState
      TState

      The state that will be passed to the operation.

    Returns

    • System.Threading.Tasks.Task<TResult><TResult>
      System.Threading.Tasks.Task<TResult>(Of TResult)

      A task that will run to completion if the original task completes successfully (either the first time or after retrying transient failures). If the task fails with a non-transient error or the retry limit is reached, the returned task will become faulted and the exception must be observed.

Details

Assembly

Microsoft.EntityFrameworkCore.dll