😎代码优化
This commit is contained in:
parent
ff8d04d394
commit
5c985d1ef2
@ -347,7 +347,7 @@ public static class SqlSugarSetup
|
|||||||
var storage = dbProvider.StorageableByObject(seedData.ToList()).ToStorage();
|
var storage = dbProvider.StorageableByObject(seedData.ToList()).ToStorage();
|
||||||
storage.AsInsertable.ExecuteCommand();
|
storage.AsInsertable.ExecuteCommand();
|
||||||
if (seedType.GetCustomAttribute<IgnoreUpdateSeedAttribute>() == null) // 有忽略更新种子特性时则不更新
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user