diff --git a/src/HeartTrackAPI/AppBootstrap.cs b/src/HeartTrackAPI/AppBootstrap.cs index c8e3603..fdbe6a0 100644 --- a/src/HeartTrackAPI/AppBootstrap.cs +++ b/src/HeartTrackAPI/AppBootstrap.cs @@ -61,8 +61,6 @@ public class AppBootstrap(IConfiguration configuration) services.AddDbContext(options => options.UseMySql($"{connectionString}", new MySqlServerVersion(new Version(10, 11, 1))) , ServiceLifetime.Singleton); - services.AddSingleton(provider => new DbDataManager(provider.GetRequiredService())); - break; default: connectionString = Configuration.GetConnectionString("HeartTrackAuthConnection"); @@ -102,7 +100,9 @@ public class AppBootstrap(IConfiguration configuration) private void AddModelService(IServiceCollection services) { //services.AddSingleton(provider => new DbDataManager(provider.GetService())); - services.AddSingleton(); + //services.AddSingleton(); + services.AddSingleton(provider => new DbDataManager(provider.GetRequiredService())); + //services.AddTransient(); }