Преглед на файлове

修复初始化种子数据的bug

富鑫 刘 преди 4 години
родител
ревизия
57ae425731
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      Admin.NET/Admin.NET.Core/SqlSugar/SqlSugarSetup.cs

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

@@ -177,6 +177,7 @@ public static class SqlSugarSetup
             var provider = db.GetConnectionScope(tAtt == null ? SqlSugarConst.ConfigId : tAtt.configId);
             var provider = db.GetConnectionScope(tAtt == null ? SqlSugarConst.ConfigId : tAtt.configId);
 
 
             var seedDataTable = seedData.ToList().ToDataTable();
             var seedDataTable = seedData.ToList().ToDataTable();
+            seedDataTable.TableName = db.EntityMaintenance.GetEntityInfo(entityType).DbTableName;
             if (seedDataTable.Columns.Contains(SqlSugarConst.PrimaryKey))
             if (seedDataTable.Columns.Contains(SqlSugarConst.PrimaryKey))
             {
             {
                 var storage = provider.Storageable(seedDataTable).WhereColumns(SqlSugarConst.PrimaryKey).ToStorage();
                 var storage = provider.Storageable(seedDataTable).WhereColumns(SqlSugarConst.PrimaryKey).ToStorage();