Table of Contents

Class ExecutionStrategyExtensions

Namespace
Microsoft.EntityFrameworkCore
Assembly
Microsoft.EntityFrameworkCore.dll

Extension methods for IExecutionStrategy

public static class ExecutionStrategyExtensions
Inheritance
ExecutionStrategyExtensions
Inherited Members

Remarks

See Connection resiliency and database retries for more information and examples.

Methods

Execute(IExecutionStrategy, Action)

Executes the specified operation.

public static void Execute(this IExecutionStrategy strategy, Action operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Action

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

Remarks

See Connection resiliency and database retries for more information and examples.

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

Executes the specified asynchronous operation.

public static Task ExecuteAsync(this IExecutionStrategy strategy, Func<CancellationToken, Task> operation, CancellationToken cancellationToken)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<CancellationToken, Task>

A function that returns a started task.

cancellationToken CancellationToken

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

Returns

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.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.

ExecuteAsync(IExecutionStrategy, Func<Task>)

Executes the specified asynchronous operation.

public static Task ExecuteAsync(this IExecutionStrategy strategy, Func<Task> operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<Task>

A function that returns a started task.

Returns

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.

Remarks

See Connection resiliency and database retries for more information and examples.

ExecuteAsync<TResult>(IExecutionStrategy, Func<CancellationToken, Task<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)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<CancellationToken, Task<TResult>>

A function that returns a started task of type TResult.

cancellationToken CancellationToken

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

Returns

Task<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.

Type Parameters

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.

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

Executes the specified asynchronous operation and returns the result.

public static Task<TResult> ExecuteAsync<TResult>(this IExecutionStrategy strategy, Func<Task<TResult>> operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<Task<TResult>>

A function that returns a started task of type TResult.

Returns

Task<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.

Type Parameters

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

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

Executes the specified asynchronous operation.

public static Task ExecuteAsync<TState>(this IExecutionStrategy strategy, TState state, Func<TState, CancellationToken, Task> operation, CancellationToken cancellationToken)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, CancellationToken, Task>

A function that returns a started task.

cancellationToken CancellationToken

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

Returns

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.

Type Parameters

TState

The type of the state.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.

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

Executes the specified asynchronous operation.

public static Task ExecuteAsync<TState>(this IExecutionStrategy strategy, TState state, Func<TState, Task> operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, Task>

A function that returns a started task.

Returns

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.

Type Parameters

TState

The type of the state.

Remarks

See Connection resiliency and database retries for more information and examples.

ExecuteAsync<TState, TResult>(IExecutionStrategy, TState, Func<TState, CancellationToken, Task<TResult>>, Func<TState, CancellationToken, Task<ExecutionResult<TResult>>>?, CancellationToken)

Executes the specified asynchronous operation and returns the result.

public static Task<TResult> ExecuteAsync<TState, TResult>(this IExecutionStrategy strategy, TState state, Func<TState, CancellationToken, Task<TResult>> operation, Func<TState, CancellationToken, Task<ExecutionResult<TResult>>>? verifySucceeded, CancellationToken cancellationToken = default)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, CancellationToken, Task<TResult>>

A function that returns a started task of type TResult.

verifySucceeded Func<TState, CancellationToken, Task<ExecutionResult<TResult>>>

A delegate that tests whether the operation succeeded even though an exception was thrown.

cancellationToken CancellationToken

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

Returns

Task<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.

Type Parameters

TState

The type of the state.

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

OperationCanceledException

If the CancellationToken is canceled.

ExecuteAsync<TState, TResult>(IExecutionStrategy, TState, Func<TState, CancellationToken, Task<TResult>>, CancellationToken)

Executes the specified asynchronous operation and returns the result.

public static Task<TResult> ExecuteAsync<TState, TResult>(this IExecutionStrategy strategy, TState state, Func<TState, CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, CancellationToken, Task<TResult>>

A function that returns a started task of type TResult.

cancellationToken CancellationToken

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

Returns

Task<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.

Type Parameters

TState

The type of the state.

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

OperationCanceledException

If the CancellationToken is canceled.

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

Executes the specified asynchronous operation and returns the result.

public static Task<TResult> ExecuteAsync<TState, TResult>(this IExecutionStrategy strategy, TState state, Func<TState, Task<TResult>> operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, Task<TResult>>

A function that returns a started task of type TResult.

Returns

Task<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.

Type Parameters

TState

The type of the state.

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

ExecuteInTransaction(IExecutionStrategy, Action, Func<bool>)

Executes the specified operation in a transaction. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static void ExecuteInTransaction(this IExecutionStrategy strategy, Action operation, Func<bool> verifySucceeded)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Action

A delegate representing an executable operation.

verifySucceeded Func<bool>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

ExecuteInTransactionAsync(IExecutionStrategy, Func<CancellationToken, Task>, Func<CancellationToken, Task<bool>>, CancellationToken)

Executes the specified asynchronous operation in a transaction. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static Task ExecuteInTransactionAsync(this IExecutionStrategy strategy, Func<CancellationToken, Task> operation, Func<CancellationToken, Task<bool>> verifySucceeded, CancellationToken cancellationToken = default)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<CancellationToken, Task>

A function that returns a started task.

verifySucceeded Func<CancellationToken, Task<bool>>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

cancellationToken CancellationToken

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

Returns

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.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

OperationCanceledException

If the CancellationToken is canceled.

ExecuteInTransactionAsync(IExecutionStrategy, Func<Task>, Func<Task<bool>>)

Executes the specified asynchronous operation in a transaction. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static Task ExecuteInTransactionAsync(this IExecutionStrategy strategy, Func<Task> operation, Func<Task<bool>> verifySucceeded)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<Task>

A function that returns a started task.

verifySucceeded Func<Task<bool>>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

Returns

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.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

ExecuteInTransactionAsync<TResult>(IExecutionStrategy, Func<CancellationToken, Task<TResult>>, Func<CancellationToken, Task<bool>>, CancellationToken)

Executes the specified asynchronous operation in a transaction and returns the result. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static Task<TResult> ExecuteInTransactionAsync<TResult>(this IExecutionStrategy strategy, Func<CancellationToken, Task<TResult>> operation, Func<CancellationToken, Task<bool>> verifySucceeded, CancellationToken cancellationToken = default)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<CancellationToken, Task<TResult>>

A function that returns a started task of type TResult.

verifySucceeded Func<CancellationToken, Task<bool>>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

cancellationToken CancellationToken

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

Returns

Task<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.

Type Parameters

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

OperationCanceledException

If the CancellationToken is canceled.

ExecuteInTransactionAsync<TState>(IExecutionStrategy, TState, Func<TState, CancellationToken, Task>, Func<TState, CancellationToken, Task<bool>>, CancellationToken)

Executes the specified asynchronous operation in a transaction. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static Task ExecuteInTransactionAsync<TState>(this IExecutionStrategy strategy, TState state, Func<TState, CancellationToken, Task> operation, Func<TState, CancellationToken, Task<bool>> verifySucceeded, CancellationToken cancellationToken = default)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, CancellationToken, Task>

A function that returns a started task.

verifySucceeded Func<TState, CancellationToken, Task<bool>>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

cancellationToken CancellationToken

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

Returns

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.

Type Parameters

TState

The type of the state.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

OperationCanceledException

If the CancellationToken is canceled.

ExecuteInTransactionAsync<TState, TResult>(IExecutionStrategy, TState, Func<TState, CancellationToken, Task<TResult>>, Func<TState, CancellationToken, Task<bool>>, Func<DbContext, CancellationToken, Task<IDbContextTransaction>>, CancellationToken)

Executes the specified asynchronous operation in a transaction and returns the result. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static Task<TResult> ExecuteInTransactionAsync<TState, TResult>(IExecutionStrategy strategy, TState state, Func<TState, CancellationToken, Task<TResult>> operation, Func<TState, CancellationToken, Task<bool>> verifySucceeded, Func<DbContext, CancellationToken, Task<IDbContextTransaction>> beginTransaction, CancellationToken cancellationToken = default)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, CancellationToken, Task<TResult>>

A function that returns a started task of type TResult.

verifySucceeded Func<TState, CancellationToken, Task<bool>>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

beginTransaction Func<DbContext, CancellationToken, Task<IDbContextTransaction>>

A delegate that begins a transaction using the given context.

cancellationToken CancellationToken

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

Returns

Task<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.

Type Parameters

TState

The type of the state.

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

OperationCanceledException

If the CancellationToken is canceled.

ExecuteInTransactionAsync<TState, TResult>(IExecutionStrategy, TState, Func<TState, CancellationToken, Task<TResult>>, Func<TState, CancellationToken, Task<bool>>, CancellationToken)

Executes the specified asynchronous operation in a transaction and returns the result. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static Task<TResult> ExecuteInTransactionAsync<TState, TResult>(this IExecutionStrategy strategy, TState state, Func<TState, CancellationToken, Task<TResult>> operation, Func<TState, CancellationToken, Task<bool>> verifySucceeded, CancellationToken cancellationToken = default)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, CancellationToken, Task<TResult>>

A function that returns a started task of type TResult.

verifySucceeded Func<TState, CancellationToken, Task<bool>>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

cancellationToken CancellationToken

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

Returns

Task<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.

Type Parameters

TState

The type of the state.

TResult

The result type of the Task<TResult> returned by operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

OperationCanceledException

If the CancellationToken is canceled.

ExecuteInTransaction<TResult>(IExecutionStrategy, Func<TResult>, Func<bool>)

Executes the specified operation in a transaction and returns the result. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static TResult ExecuteInTransaction<TResult>(this IExecutionStrategy strategy, Func<TResult> operation, Func<bool> verifySucceeded)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<TResult>

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

verifySucceeded Func<bool>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

Returns

TResult

The result from the operation.

Type Parameters

TResult

The return type of operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

ExecuteInTransaction<TState>(IExecutionStrategy, TState, Action<TState>, Func<TState, bool>)

Executes the specified operation in a transaction. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static void ExecuteInTransaction<TState>(this IExecutionStrategy strategy, TState state, Action<TState> operation, Func<TState, bool> verifySucceeded)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Action<TState>

A delegate representing an executable operation.

verifySucceeded Func<TState, bool>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

Type Parameters

TState

The type of the state.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

ExecuteInTransaction<TState, TResult>(IExecutionStrategy, TState, Func<TState, TResult>, Func<TState, bool>)

Executes the specified operation in a transaction and returns the result. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static TResult ExecuteInTransaction<TState, TResult>(this IExecutionStrategy strategy, TState state, Func<TState, TResult> operation, Func<TState, bool> verifySucceeded)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, TResult>

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

verifySucceeded Func<TState, bool>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

Returns

TResult

The result from the operation.

Type Parameters

TState

The type of the state.

TResult

The return type of operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

ExecuteInTransaction<TState, TResult>(IExecutionStrategy, TState, Func<TState, TResult>, Func<TState, bool>, Func<DbContext, IDbContextTransaction>)

Executes the specified operation in a transaction and returns the result. Allows to check whether the transaction has been rolled back if an error occurs during commit.

public static TResult ExecuteInTransaction<TState, TResult>(IExecutionStrategy strategy, TState state, Func<TState, TResult> operation, Func<TState, bool> verifySucceeded, Func<DbContext, IDbContextTransaction> beginTransaction)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, TResult>

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

verifySucceeded Func<TState, bool>

A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.

beginTransaction Func<DbContext, IDbContextTransaction>

A delegate that begins a transaction using the given context.

Returns

TResult

The result from the operation.

Type Parameters

TState

The type of the state.

TResult

The return type of operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.

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

Executes the specified operation and returns the result.

public static TResult Execute<TResult>(this IExecutionStrategy strategy, Func<TResult> operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

operation Func<TResult>

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

Returns

TResult

The result from the operation.

Type Parameters

TResult

The return type of operation.

Remarks

See Connection resiliency and database retries for more information and examples.

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

Executes the specified operation.

public static void Execute<TState>(this IExecutionStrategy strategy, TState state, Action<TState> operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Action<TState>

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

Type Parameters

TState

The type of the state.

Remarks

See Connection resiliency and database retries for more information and examples.

Execute<TState, TResult>(IExecutionStrategy, TState, Func<TState, TResult>)

Executes the specified operation and returns the result.

public static TResult Execute<TState, TResult>(this IExecutionStrategy strategy, TState state, Func<TState, TResult> operation)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, TResult>

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

Returns

TResult

The result from the operation.

Type Parameters

TState

The type of the state.

TResult

The return type of operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Execute<TState, TResult>(IExecutionStrategy, TState, Func<TState, TResult>, Func<TState, ExecutionResult<TResult>>?)

Executes the specified operation and returns the result.

public static TResult Execute<TState, TResult>(this IExecutionStrategy strategy, TState state, Func<TState, TResult> operation, Func<TState, ExecutionResult<TResult>>? verifySucceeded)

Parameters

strategy IExecutionStrategy

The strategy that will be used for the execution.

state TState

The state that will be passed to the operation.

operation Func<TState, TResult>

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

verifySucceeded Func<TState, ExecutionResult<TResult>>

A delegate that tests whether the operation succeeded even though an exception was thrown.

Returns

TResult

The result from the operation.

Type Parameters

TState

The type of the state.

TResult

The return type of operation.

Remarks

See Connection resiliency and database retries for more information and examples.

Exceptions

RetryLimitExceededException

The operation has not succeeded after the configured number of retries.