diff --git a/Server/src/SOR.Ai/ServiceRegistration.cs b/Server/src/SOR.Ai/ServiceRegistration.cs index 8e8da38..b2166db 100644 --- a/Server/src/SOR.Ai/ServiceRegistration.cs +++ b/Server/src/SOR.Ai/ServiceRegistration.cs @@ -13,6 +13,7 @@ using SOR.Ai.Seeding; using SOR.Ai.Training; using SOR.Networking.Abstractions.Messaging; using SOR.Shared; +using SOR.Database; using SOR.Database.Contexts; /// @@ -26,6 +27,12 @@ public static class ServiceRegistration this IServiceCollection services, IConfiguration configuration) { + // ── Database contexts required by AI services ───────────────────────── + // AiDeckResolver needs BazaarDbContext to look up prebuilt decks. + // Safe to call even when AddBazaarService is also registered on the same host — + // EF Core resolves the last AddDbContext registration, and both point to the same DB. + services.AddBazaarDatabase(configuration); + // ── Startup seed (one-shot IHostedService) ──────────────────────────── // Ensures AI accounts exist in the DB before traffic is accepted. services.AddHostedService();