Jelajahi Sumber

😎恢复日志仓储切换

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

+ 7 - 7
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarRepository.cs

@@ -22,13 +22,13 @@ public class SqlSugarRepository<T> : SimpleClient<T> where T : class, new()
             return;
         }
 
-        //// 若实体贴有日志表特性,则返回日志库连接
-        //if (typeof(T).IsDefined(typeof(LogTableAttribute), false))
-        //{
-        //    if (iTenant.IsAnyConnection(SqlSugarConst.LogConfigId))
-        //        base.Context = iTenant.GetConnectionScope(SqlSugarConst.LogConfigId);
-        //    return;
-        //}
+        // 若实体贴有日志表特性,则返回日志库连接
+        if (typeof(T).IsDefined(typeof(LogTableAttribute), false))
+        {
+            if (iTenant.IsAnyConnection(SqlSugarConst.LogConfigId))
+                base.Context = iTenant.GetConnectionScope(SqlSugarConst.LogConfigId);
+            return;
+        }
 
         // 若实体贴有系统表特性,则返回默认库连接
         if (typeof(T).IsDefined(typeof(SysTableAttribute), false))