IDbExecutionStrategy.ExecuteAsync 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.
Overloads
ExecuteAsync(Func<Task>, CancellationToken) |
Executes the specified asynchronous operation. |
ExecuteAsync<TResult>(Func<Task<TResult>>, CancellationToken) |
Executes the specified asynchronous operation and returns the result. |
ExecuteAsync(Func<Task>, CancellationToken)
Executes the specified asynchronous operation.
public System.Threading.Tasks.Task ExecuteAsync (Func<System.Threading.Tasks.Task> operation, System.Threading.CancellationToken cancellationToken);
abstract member ExecuteAsync : Func<System.Threading.Tasks.Task> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Parameters
- cancellationToken
- CancellationToken
A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.
Returns
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.
Applies to
ExecuteAsync<TResult>(Func<Task<TResult>>, CancellationToken)
Executes the specified asynchronous operation and returns the result.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public System.Threading.Tasks.Task<TResult> ExecuteAsync<TResult> (Func<System.Threading.Tasks.Task<TResult>> operation, System.Threading.CancellationToken cancellationToken);
abstract member ExecuteAsync : Func<System.Threading.Tasks.Task<'Result>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Type Parameters
- TResult
The result type of the Task<TResult> returned by operation
.
Parameters
- cancellationToken
- CancellationToken
A cancellation token used to cancel the retry operation, but not operations that are already in flight or that already completed successfully.
Returns
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.
- Attributes
Applies to
Entity Framework