Skip to content

Document the common API methods the ExecutionStrategy does (not) apply to #2566

Open
@mattbrooks2010

Description

@mattbrooks2010

The content on this topic is really useful. However, it doesn't clearly document the common API methods the ExecutionStrategy does — and does not — apply to.

For my purposes, I needed to know whether ExecuteSqlCommandAsync used the current ExecutionStrategy after seeing transient errors impact a web application health check.

Use case question: https://twitter.com/mattbrooks2010/status/1286063862370971648

Use case solution:

await context.Database.CreateExecutionStrategy().ExecuteAsync(async () =>
{
    // Check we can communicate successfully with the app database.
    await context.Database.ExecuteSqlCommandAsync("SELECT 1");
});

A colleague of mine did eventually find this existing API documentation: https://github.com/dotnet/efcore/blob/59734ea22f29d22f8d0c1673c59a99c54ec4e78d/src/EFCore.Relational/Extensions/RelationalDatabaseFacadeExtensions.cs#L120-L123


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions