Bladeren bron

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

zuohuaijun 1 jaar geleden
bovenliggende
commit
3f4496ca6a
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      Admin.NET/Admin.NET.Core/EventBus/AppEventSubscriber.cs

+ 2 - 2
Admin.NET/Admin.NET.Core/EventBus/AppEventSubscriber.cs

@@ -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>