😎 优化事件总线数据库存储
This commit is contained in:
parent
85d02a8997
commit
e38e533221
@ -26,8 +26,8 @@ public class AppEventSubscriber : IEventSubscriber, ISingleton, IDisposable
|
|||||||
[EventSubscribe(CommonConst.AddExLog)]
|
[EventSubscribe(CommonConst.AddExLog)]
|
||||||
public async Task CreateExLog(EventHandlerExecutingContext context)
|
public async Task CreateExLog(EventHandlerExecutingContext context)
|
||||||
{
|
{
|
||||||
var rep = _serviceScope.ServiceProvider.GetRequiredService<SqlSugarRepository<SysLogEx>>();
|
var db = _serviceScope.ServiceProvider.GetRequiredService<ISqlSugarClient>();
|
||||||
await rep.InsertAsync((SysLogEx)context.Source.Payload);
|
await db.CopyNew().Insertable((SysLogEx)context.Source.Payload).ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user