|
|
@ -80,22 +80,13 @@ public class AppBootstrap(IConfiguration configuration)
|
|
|
|
switch (Environment.GetEnvironmentVariable("TYPE"))
|
|
|
|
switch (Environment.GetEnvironmentVariable("TYPE"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case "BDD":
|
|
|
|
case "BDD":
|
|
|
|
// services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetRequiredService<HeartTrackContext>()));
|
|
|
|
services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetRequiredService<HeartTrackContext>()));
|
|
|
|
services.AddSingleton<IDataManager>(provider =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
provider.GetRequiredService<TrainingStubbedContext>().Database.EnsureCreated();
|
|
|
|
|
|
|
|
return new DbDataManager(provider.GetRequiredService<HeartTrackContext>());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "STUB-MODEL":
|
|
|
|
case "STUB-MODEL":
|
|
|
|
services.AddSingleton<IDataManager, StubData>();
|
|
|
|
services.AddSingleton<IDataManager, StubData>();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
services.AddSingleton<IDataManager>(provider =>
|
|
|
|
services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetRequiredService<TrainingStubbedContext>()));
|
|
|
|
{
|
|
|
|
|
|
|
|
provider.GetRequiredService<TrainingStubbedContext>().Database.EnsureCreated();
|
|
|
|
|
|
|
|
return new DbDataManager(provider.GetRequiredService<TrainingStubbedContext>());
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|