Open
Description
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.
- ID: 876c88d4-2972-d905-28d7-56f9e589f309
- Version Independent ID: 29002343-fa42-2f49-3362-53592039b26d
- Content: Connection Resiliency - EF Core
- Content Source: entity-framework/core/miscellaneous/connection-resiliency.md
- Product: entity-framework
- Technology: entity-framework-core
- GitHub Login: @rowanmiller
- Microsoft Alias: avickers