[성현모] EFCore 기능 추, dll 버전 추가

This commit is contained in:
SHM
2025-04-22 08:26:04 +09:00
parent aaf104a915
commit 0b69e0a8f7
13 changed files with 190 additions and 79 deletions

View File

@ -1,6 +1,7 @@
using HubX.Library.Config;
using HubX.Library.Socket.Session;
using HubX.Server;
using HubX.Server.Services;
using HubX.Server.TaskManager;
using System.Net;
using System.Net.Sockets;
@ -27,10 +28,15 @@ builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddHttpContextAccessor();
//singleton
builder.Services.AddSingleton<ConfigService<WebApiConfig>>();
//scoped
builder.Services.AddSingleton<EFCoreService>();
builder.Services.AddSingleton<UniqueKeyService>();
//config preload
ConfigService<WebApiConfig> preloadConfig = new ConfigService<WebApiConfig>();
if (preloadConfig.OpenConfig($@"{configDir}/HubX.WebApiConfig.json") == true)
@ -84,8 +90,8 @@ if (app.Environment.IsDevelopment())
TaskSocket taskSocket = new TaskSocket();
taskSocket?.Run(socketPort);
app.UseAuthentication();
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();