😎代码优化

This commit is contained in:
zuohuaijun 2024-07-07 02:25:08 +08:00
parent ff8d04d394
commit 5c985d1ef2

View File

@ -347,7 +347,7 @@ public static class SqlSugarSetup
var storage = dbProvider.StorageableByObject(seedData.ToList()).ToStorage();
storage.AsInsertable.ExecuteCommand();
if (seedType.GetCustomAttribute<IgnoreUpdateSeedAttribute>() == null) // 有忽略更新种子特性时则不更新
storage.AsUpdateable.IgnoreColumns(entityInfo.Columns.Where(c => c.PropertyInfo.GetCustomAttribute<IgnoreUpdateSeedColumnAttribute>() != null).Select(c => c.PropertyName).ToArray()).ExecuteCommand();
storage.AsUpdateable.IgnoreColumns(entityInfo.Columns.Where(u => u.PropertyInfo.GetCustomAttribute<IgnoreUpdateSeedColumnAttribute>() != null).Select(u => u.PropertyName).ToArray()).ExecuteCommand();
}
else
{