Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore 10.0.0
About
Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore provides components for performing health checks using Entity Framework Core (EF Core).
How to Use
To use Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore, follow these steps:
Installation
dotnet add package Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore
Configuration
To add a health check for an EF Core DbContext, use the AddDbContextCheck extension method to configure it with your app's service provider. Here's an example:
builder.Services.AddDbContext<SampleDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")));
builder.Services.AddHealthChecks()
.AddDbContextCheck<SampleDbContext>();
Additional Documentation
For additional documentation and examples, refer to the official documentation on using the Entity Framework Core DbContext probe.
Feedback & Contributing
Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.
| Packages | Downloads |
|---|---|
|
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL
A PostgreSQL® provider for Entity Framework Core that integrates with Aspire, including connection pooling, health checks, logging, and telemetry.
|
2 |
.NET 10.0
- Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0)