ExecutionStrategy.ExecuteInTransaction<TState,TResult> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Executes the specified operation in a transaction and returns the result after commiting it.
public virtual TResult ExecuteInTransaction<TState,TResult> (Func<TState,TResult> operation, Func<TState,bool> verifySucceeded, TState state);
abstract member ExecuteInTransaction : Func<'State, 'Result> * Func<'State, bool> * 'State -> 'Result
override this.ExecuteInTransaction : Func<'State, 'Result> * Func<'State, bool> * 'State -> 'Result
Public Overridable Function ExecuteInTransaction(Of TState, TResult) (operation As Func(Of TState, TResult), verifySucceeded As Func(Of TState, Boolean), 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
.
A delegate that tests whether the operation succeeded even though an exception was thrown when the transaction was being committed.
- state
- TState
The state that will be passed to the operation.
Returns
The result from the operation.
Exceptions
Thrown if the operation has not succeeded after the configured number of retries.
Applies to
Entity Framework