DbExecutionStrategy.Execute Method

 

Namespace:   System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodExecute(Action)

Repetitively executes the specified operation while it satisfies the current retry policy.

System_CAPS_pubmethodExecute<TResult>(Func<TResult>)

Repetitively executes the specified operation while it satisfies the current retry policy.


DbExecutionStrategy.Execute Method (Action)

Repetitively executes the specified operation while it satisfies the current retry policy.

public void Execute(
	Action operation
)

Parameters

operation
Type: System.Action

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

Exception Condition
RetryLimitExceededException

If the retry delay strategy determines the operation should not be retried anymore.

InvalidOperationException

If an existing transaction is detected and the execution strategy does not support it.

InvalidOperationException

If this instance was already used to execute an operation.


DbExecutionStrategy.Execute<TResult> Method (Func<TResult>)

Repetitively executes the specified operation while it satisfies the current retry policy.

public TResult Execute<TResult>(
	Func<TResult> operation
)

Parameters

operation
Type: System.Func<TResult>

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

Return Value

Type: TResult

The result from the operation.

Type Parameters

TResult

The type of result expected from the executable operation.

Exception Condition
RetryLimitExceededException

If the retry delay strategy determines the operation should not be retried anymore.

InvalidOperationException

If an existing transaction is detected and the execution strategy does not support it.

InvalidOperationException

If this instance was already used to execute an operation.