|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using DbContextLib;
|
|
|
|
|
using DbContextLib.Identity;
|
|
|
|
|
using HeartTrackAPI.Utils;
|
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc.Versioning;
|
|
|
|
@ -14,7 +13,7 @@ using StubAPI;
|
|
|
|
|
using StubbedContextLib;
|
|
|
|
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
|
|
|
|
|
|
|
|
|
namespace HeartTrackAPI;
|
|
|
|
|
namespace HeartTrackAPI.Utils;
|
|
|
|
|
public class AppBootstrap(IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
private IConfiguration Configuration { get; } = configuration;
|
|
|
|
@ -48,8 +47,7 @@ public class AppBootstrap(IConfiguration configuration)
|
|
|
|
|
connectionString = $"Server={host};port={port};database={database};user={username};password={password}";
|
|
|
|
|
Console.WriteLine("========RUNNING USING THE MYSQL SERVER==============");
|
|
|
|
|
Console.WriteLine(connectionString);
|
|
|
|
|
Console.WriteLine(connectionString);
|
|
|
|
|
Console.WriteLine("======================");
|
|
|
|
|
Console.WriteLine("====================================================");
|
|
|
|
|
services.AddDbContext<AuthDbContext>(options => options.UseInMemoryDatabase("AuthDb"));
|
|
|
|
|
services.AddDbContext<HeartTrackContext>(options =>
|
|
|
|
|
options.UseMySql($"{connectionString}", new MySqlServerVersion(new Version(10, 11, 1)))
|
|
|
|
@ -89,8 +87,6 @@ public class AppBootstrap(IConfiguration configuration)
|
|
|
|
|
services.AddSingleton<IDataManager>(provider => new DbDataManager(provider.GetRequiredService<TrainingStubbedContext>()));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//services.AddTransient<IActivityManager, ActivityManager>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AddIdentityServices(IServiceCollection services)
|
|
|
|
|