Forráskód Böngészése

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

Signed-off-by: 清子 <261617183@qq.com>
清子 3 éve
szülő
commit
d54ca940c7

+ 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(),
         };
         };