Quellcode durchsuchen

update Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs.
限制只对名称和类型相同的Id属性调整值;兼容其他类型有需要值为0的场景

Signed-off-by: Lzh666 <422235757@qq.com>

Lzh666 vor 10 Monaten
Ursprung
Commit
690ab39edd
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

+ 1 - 1
Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

@@ -575,7 +575,7 @@ public static class SqlSugarSetup
         foreach (var data in seedData)
         {
             var idProperty = data.GetType().GetProperty(nameof(EntityBaseId.Id));
-            if (idProperty == null) continue;
+            if (idProperty == null || idProperty.PropertyType != typeof(Int64)) continue;
 
             var idValue = idProperty.GetValue(data);
             if (idValue == null || idValue.ToString() == "0" || string.IsNullOrWhiteSpace(idValue.ToString()))