You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make EnrichSqliteDatabaseDbContext follow the Aspire enrich pattern by requiring the DbContext to already be registered instead of registering it itself.
Update the tests to reflect the new contract, including coverage
for missing DbContext registration and successful enrichment of an
existing registration.
/// Enriches a <see cref="IHostApplicationBuilder"/> to register the <typeparamref name="TDbContext"/> as a scoped service
75
-
/// with simplified configuration and optional OpenTelemetry instrumentation.
74
+
/// Configures retries, health check, logging and telemetry for the <see cref="DbContext" />.
76
75
/// </summary>
77
76
/// <typeparam name="TDbContext">The type of the <see cref="DbContext"/>.</typeparam>
78
77
/// <param name="builder">The <see cref="IHostApplicationBuilder"/> to read config from and add services to.</param>
79
78
/// <param name="configureSettings">An optional delegate that can be used for customizing options. It's invoked after the settings are read from the configuration.</param>
80
79
/// <exception cref="ArgumentNullException">Thrown if mandatory <paramref name="builder"/> is null.</exception>
80
+
/// <exception cref="InvalidOperationException">Thrown when mandatory <see cref="DbContext"/> is not registered in DI.</exception>
Copy file name to clipboardExpand all lines: tests/CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite.Tests/EnrichSqliteDatabaseDbContextTests.cs
0 commit comments