IExecutionStrategy.Execute Method

Definition

Overloads

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

Executes the specified operation and returns the result.

Execute<TState,TResult>(TState, Func<DbContext,TState,TResult>, Func<DbContext,TState,ExecutionResult<TResult>>)

Executes the specified operation and returns the result.

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

Executes the specified operation and returns the result.

public TResult Execute<TState,TResult> (Func<TState,TResult> operation, Func<TState,Microsoft.EntityFrameworkCore.Storage.ExecutionResult<TResult>> verifySucceeded, TState state);
abstract member Execute : Func<'State, 'Result> * Func<'State, Microsoft.EntityFrameworkCore.Storage.ExecutionResult<'Result>> * 'State -> 'Result
Public Function Execute(Of TState, TResult) (operation As Func(Of TState, TResult), verifySucceeded As Func(Of TState, ExecutionResult(Of TResult)), state As TState) As TResult

Type Parameters

TState

The type of the state.

TResult

The return type of operation.

Parameters

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.

state
TState

The state that will be passed to the operation.

Returns

TResult

The result from the operation.

Exceptions

Thrown if the operation has not succeeded after the configured number of retries.

Applies to

Execute<TState,TResult>(TState, Func<DbContext,TState,TResult>, Func<DbContext,TState,ExecutionResult<TResult>>)

Executes the specified operation and returns the result.

public TResult Execute<TState,TResult> (TState state, Func<Microsoft.EntityFrameworkCore.DbContext,TState,TResult> operation, Func<Microsoft.EntityFrameworkCore.DbContext,TState,Microsoft.EntityFrameworkCore.Storage.ExecutionResult<TResult>> verifySucceeded);
public TResult Execute<TState,TResult> (TState state, Func<Microsoft.EntityFrameworkCore.DbContext,TState,TResult> operation, Func<Microsoft.EntityFrameworkCore.DbContext,TState,Microsoft.EntityFrameworkCore.Storage.ExecutionResult<TResult>>? verifySucceeded);
abstract member Execute : 'State * Func<Microsoft.EntityFrameworkCore.DbContext, 'State, 'Result> * Func<Microsoft.EntityFrameworkCore.DbContext, 'State, Microsoft.EntityFrameworkCore.Storage.ExecutionResult<'Result>> -> 'Result
Public Function Execute(Of TState, TResult) (state As TState, operation As Func(Of DbContext, TState, TResult), verifySucceeded As Func(Of DbContext, TState, ExecutionResult(Of TResult))) As TResult

Type Parameters

TState

The type of the state.

TResult

The return type of operation.

Parameters

state
TState

The state that will be passed to the operation.

operation
Func<DbContext,TState,TResult>

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

verifySucceeded
Func<DbContext,TState,ExecutionResult<TResult>>

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

Returns

TResult

The result from the operation.

Exceptions

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

Remarks

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

Applies to