Jelajahi Sumber

😁优化SqlSugar仓储基类

zuohuaijun 2 tahun lalu
induk
melakukan
cf7fb837e1
1 mengubah file dengan 2 tambahan dan 3 penghapusan
  1. 2 3
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarRepository.cs

+ 2 - 3
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarRepository.cs

@@ -24,9 +24,8 @@ public class SqlSugarRepository<T> : SimpleClient<T> where T : class, new()
         // 若实体贴有日志表特性,则返回日志库连接
         if (typeof(T).IsDefined(typeof(LogTableAttribute), false))
         {
-            var sqlSugarScopeProviderLog = iTenant.GetConnectionScope(SqlSugarConst.LogConfigId);
-            if (sqlSugarScopeProviderLog != null)
-                base.Context = sqlSugarScopeProviderLog;
+            if (iTenant.IsAnyConnection(SqlSugarConst.LogConfigId))
+                base.Context = iTenant.GetConnectionScope(SqlSugarConst.LogConfigId);
             return;
         }