Share via


NonRetryingExecutionStrategy.Execute<TState,TResult> Method

Definition

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
override this.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.

Implements

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