😎 优化事件总线数据库存储

This commit is contained in:
zuohuaijun 2024-08-20 20:46:49 +08:00
parent 85d02a8997
commit e38e533221

View File

@ -26,8 +26,8 @@ public class AppEventSubscriber : IEventSubscriber, ISingleton, IDisposable
[EventSubscribe(CommonConst.AddExLog)]
public async Task CreateExLog(EventHandlerExecutingContext context)
{
var rep = _serviceScope.ServiceProvider.GetRequiredService<SqlSugarRepository<SysLogEx>>();
await rep.InsertAsync((SysLogEx)context.Source.Payload);
var db = _serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>();
await db.CopyNew().Insertable((SysLogEx)context.Source.Payload).ExecuteCommandAsync();
}
/// <summary>