升级.net8暂存
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using Jaina;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SqlSugar;
|
||||
using System.Threading.Tasks;
|
||||
using HT.Cloud.Code;
|
||||
using HT.Cloud.Domain.SystemSecurity;
|
||||
@ -21,12 +22,18 @@ namespace HT.Cloud.Service.Event
|
||||
var todo = (BaseEventSource)context.Source;
|
||||
var input = (LogEntity)todo.Payload;
|
||||
var user = todo.User;
|
||||
using (var serviceProvider = GlobalContext.RootServices.CreateScope())
|
||||
{
|
||||
var logService = serviceProvider.ServiceProvider.GetService<LogService>();
|
||||
await logService.WriteDbLog(input, user);
|
||||
}
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
using var dbContext = new SqlSugarClient(DBInitialize.GetConnectionConfigs(true),
|
||||
//全局上下文生效
|
||||
db =>
|
||||
{
|
||||
foreach (var item in DBInitialize.GetConnectionConfigs(false))
|
||||
{
|
||||
string temp = item.ConfigId;
|
||||
db.GetConnection(temp).DefaultConfig();
|
||||
}
|
||||
});
|
||||
await new LogService(dbContext).WriteDbLog(input, user);
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user