|
|
@ -61,8 +61,6 @@ public class AppBootstrap(IConfiguration configuration)
|
|
|
|
services.AddDbContext<HeartTrackContext>(options =>
|
|
|
|
services.AddDbContext<HeartTrackContext>(options =>
|
|
|
|
options.UseMySql($"{connectionString}", new MySqlServerVersion(new Version(10, 11, 1)))
|
|
|
|
options.UseMySql($"{connectionString}", new MySqlServerVersion(new Version(10, 11, 1)))
|
|
|
|
, ServiceLifetime.Singleton);
|
|
|
|
, ServiceLifetime.Singleton);
|
|
|
|
services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetRequiredService<HeartTrackContext>()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
connectionString = Configuration.GetConnectionString("HeartTrackAuthConnection");
|
|
|
|
connectionString = Configuration.GetConnectionString("HeartTrackAuthConnection");
|
|
|
@ -102,7 +100,9 @@ public class AppBootstrap(IConfiguration configuration)
|
|
|
|
private void AddModelService(IServiceCollection services)
|
|
|
|
private void AddModelService(IServiceCollection services)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetService<HeartTrackContext>()));
|
|
|
|
//services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetService<HeartTrackContext>()));
|
|
|
|
services.AddSingleton<IDataManager, StubData>();
|
|
|
|
//services.AddSingleton<IDataManager, StubData>();
|
|
|
|
|
|
|
|
services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetRequiredService<HeartTrackContext>()));
|
|
|
|
|
|
|
|
|
|
|
|
//services.AddTransient<IActivityManager, ActivityManager>();
|
|
|
|
//services.AddTransient<IActivityManager, ActivityManager>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|