api ระบบวินัย กรรมการ/ช่องทางร้องเรียน

This commit is contained in:
Kittapath 2023-11-18 01:43:03 +07:00
parent 9ed48d93b4
commit 2cdf724d58
69 changed files with 21578 additions and 134 deletions

View file

@ -12,7 +12,7 @@ namespace BMA.EHR.Infrastructure
public static IServiceCollection AddLeavePersistence(this IServiceCollection services,
IConfiguration configuration)
{
// leave db context
var connectionStringLeave = configuration.GetConnectionString("LeaveConnection");
@ -32,6 +32,28 @@ namespace BMA.EHR.Infrastructure
return services;
}
public static IServiceCollection AddDisciplinePersistence(this IServiceCollection services,
IConfiguration configuration)
{
// discipline db context
var connectionStringDiscipline = configuration.GetConnectionString("DisciplineConnection");
services.AddDbContext<DisciplineDbContext>(options =>
options.UseMySql(connectionStringDiscipline, ServerVersion.AutoDetect(connectionStringDiscipline),
b =>
{
b.MigrationsAssembly(typeof(DisciplineDbContext).Assembly.FullName);
b.MigrationsHistoryTable("__DisciplineMigrationsHistory");
}),
ServiceLifetime.Transient);
services.AddScoped<IDisciplineDbContext>(provider => provider.GetService<DisciplineDbContext>());
return services;
}
public static IServiceCollection AddPersistence(this IServiceCollection services,
IConfiguration configuration)