mirror of
https://github.com/project-redbud/FunGame-Server.git
synced 2026-01-19 22:18:24 +00:00
注入 SQLHelper,插件可以直接使用
This commit is contained in:
parent
449cb1df9b
commit
9dff7f7d56
@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Mvc.ApplicationParts;
|
|||||||
using Microsoft.Extensions.Logging.Console;
|
using Microsoft.Extensions.Logging.Console;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using Milimoe.FunGame;
|
using Milimoe.FunGame;
|
||||||
|
using Milimoe.FunGame.Core.Api.Transmittal;
|
||||||
using Milimoe.FunGame.Core.Api.Utility;
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
using Milimoe.FunGame.Core.Library.Common.Addon;
|
using Milimoe.FunGame.Core.Library.Common.Addon;
|
||||||
using Milimoe.FunGame.Core.Library.Common.Network;
|
using Milimoe.FunGame.Core.Library.Common.Network;
|
||||||
@ -180,6 +181,13 @@ try
|
|||||||
|
|
||||||
throw new NoUserLogonException();
|
throw new NoUserLogonException();
|
||||||
});
|
});
|
||||||
|
builder.Services.AddTransient(provider =>
|
||||||
|
{
|
||||||
|
SQLHelper? sql = Factory.OpenFactory.GetSQLHelper();
|
||||||
|
if (sql != null) return sql;
|
||||||
|
throw new SQLServiceException();
|
||||||
|
});
|
||||||
|
builder.Services.AddTransient<JsonTool>();
|
||||||
|
|
||||||
WebApplication app = builder.Build();
|
WebApplication app = builder.Build();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user