dotnet / dotnet/EntityFramework.Docs

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

Open
#2,566 0 comments 0 reactions 0 assignees View on GitHub
area-connection-resiliency
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

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:

```csharp
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](https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency)
* Content Source: [entity-framework/core/miscellaneous/connection-resiliency.md](https://github.com/dotnet/EntityFramework.Docs/blob/master/entity-framework/core/miscellaneous/connection-resiliency.md)
* Product: **entity-framework**
* Technology: **entity-framework-core**
* GitHub Login: @rowanmiller
* Microsoft Alias: **avickers**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.