Describe the bug
EnrichSqliteDatabaseDbContext does not follow the expected Aspire Enrich... pattern. Instead of enriching an already registered DbContext, it registers the DbContext itself.
This makes its behavior inconsistent with the corresponding Aspire extensions, where Enrich... methods apply cross-cutting configuration such as telemetry and health checks to an existing registration rather than creating one.
Regression
N/A
Steps to reproduce
1. Create an application builder.
2. Do not register the DbContext.
3. Call EnrichSqliteDatabaseDbContext<TDbContext>().
4. Build the application and resolve the DbContext.
Expected behavior
EnrichSqliteDatabaseDbContext should require the DbContext to already be registered.
If the DbContext has not been registered, the method should throw an InvalidOperationException. If it has been registered, the method should only apply enrichment behavior such as telemetry and health checks.
Screenshots
No response
IDE and version
Rider
IDE version
2026.1
Nuget packages
CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
Describe the bug
EnrichSqliteDatabaseDbContextdoes not follow the expected Aspire Enrich... pattern. Instead of enriching an already registered DbContext, it registers the DbContext itself.This makes its behavior inconsistent with the corresponding Aspire extensions, where Enrich... methods apply cross-cutting configuration such as telemetry and health checks to an existing registration rather than creating one.
Regression
N/A
Steps to reproduce
Expected behavior
EnrichSqliteDatabaseDbContextshould require the DbContext to already be registered.If the DbContext has not been registered, the method should throw an
InvalidOperationException. If it has been registered, the method should only apply enrichment behavior such as telemetry and health checks.Screenshots
No response
IDE and version
Rider
IDE version
2026.1
Nuget packages
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item