[성현모] EFCore 기능 추, dll 버전 추가
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user