diff --git a/src/HeartTrackAPI/Utils/AppBootstrap.cs b/src/HeartTrackAPI/Utils/AppBootstrap.cs index f7f501a..d24d155 100644 --- a/src/HeartTrackAPI/Utils/AppBootstrap.cs +++ b/src/HeartTrackAPI/Utils/AppBootstrap.cs @@ -14,7 +14,7 @@ using StubAPI; using StubbedContextLib; using Swashbuckle.AspNetCore.SwaggerGen; -namespace HeartTrackAPI.Utils; +namespace HeartTrackAPI; public class AppBootstrap(IConfiguration configuration) { private IConfiguration Configuration { get; } = configuration; @@ -80,7 +80,12 @@ public class AppBootstrap(IConfiguration configuration) switch (Environment.GetEnvironmentVariable("TYPE")) { case "BDD": - services.AddSingleton(provider => new DbDataManager(provider.GetRequiredService())); + // services.AddSingleton(provider => new DbDataManager(provider.GetRequiredService())); + services.AddSingleton(provider => + { + provider.GetRequiredService().Database.EnsureCreated(); + return new DbDataManager(provider.GetRequiredService()); + }); break; case "STUB-MODEL": services.AddSingleton();