Explorar el Código

TenantId列更新时强制忽略更新,修复生成代码把TenantId置为null的bug。

Signed-off-by: 清子 <261617183@qq.com>
清子 hace 3 años
padre
commit
d54ca940c7
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

+ 3 - 0
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

@@ -62,6 +62,9 @@ public static class SqlSugarSetup
                     if (type.PropertyType == typeof(bool) || type.PropertyType == typeof(bool?))
                     if (type.PropertyType == typeof(bool) || type.PropertyType == typeof(bool?))
                         column.DataType = "number(1)";
                         column.DataType = "number(1)";
                 }
                 }
+
+                if(column.PropertyName == "TenantId") ///租户Id列更新时强制忽略更新
+                    column.IsOnlyIgnoreUpdate = true;
             },
             },
             DataInfoCacheService = new SqlSugarCache(),
             DataInfoCacheService = new SqlSugarCache(),
         };
         };