Open
Description
Is your feature request related to a problem? Please describe.
We use the services.AddDbContextCheck<AppDbContext>()
method to monitor the connection to the database in our apps. Due to performance reasons we switched to using IDbContextFactory
to access instances of EF Core DbContext:
services.AddPooledDbContextFactory<AppDbContext>(dbContextOptions)
When we did so, we noticed that the DbContextHealthCheck
does not support the factory and, thus, we had to register the DbContext directly to keep the HealthCheck working:
// This is just required for the HealthCheck, since it does not (yet?) work with the Factory.
services.AddDbContextPool<AppDbContext>(dbContextOptions);
Describe the solution you'd like
The DbContextHealthCheck
should support IDbContextFactory
without any additional service registrations.
Additional context
We are willing to invest some time to implement this and submit a pull request. But we need some support on how we should implement this and how the API should look like.