IDbExecutionStrategy.ExecuteAsync Method

 

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

NameDescription
System_CAPS_pubmethodExecuteAsync(Func<Task>, CancellationToken)

Executes the specified asynchronous operation.

System_CAPS_pubmethodExecuteAsync<TResult>(Func<Task<TResult>>, CancellationToken)

Executes the specified asynchronous operation and returns the result.


IDbExecutionStrategy.ExecuteAsync Method (Func<Task>, CancellationToken)

Executes the specified asynchronous operation.

Task ExecuteAsync(
	Func<Task> operation,
	CancellationToken cancellationToken
)

Parameters

operation
Type: System.Func<Task>

A function that returns a started task.

cancellationToken
Type: System.Threading.CancellationToken

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

Return Value

Type: System.Threading.Tasks.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.


IDbExecutionStrategy.ExecuteAsync<TResult> Method (Func<Task<TResult>>, CancellationToken)

Executes the specified asynchronous operation and returns the result.

[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
Task<TResult> ExecuteAsync<TResult>(
	Func<Task<TResult>> operation,
	CancellationToken cancellationToken
)

Parameters

operation
Type: System.Func<Task<TResult>>

A function that returns a started task of type TResult.

cancellationToken
Type: System.Threading.CancellationToken

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

Return Value

Type: System.Threading.Tasks.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.