Update: db.UpdateNav

This commit is contained in:
sunkaixuan
2023-09-09 12:03:49 +08:00
parent 43635f1c0e
commit 72ea1d0e34

View File

@@ -86,6 +86,16 @@ namespace SqlSugar
com(updateable); com(updateable);
updateable.ExecuteCommand(); updateable.ExecuteCommand();
} }
else if (pkColumn.IsPrimarykey == false)
{
var pk= this._Context.EntityMaintenance.GetEntityInfo<TChild>().Columns.Where(it => it.IsPrimarykey);
List<string> ignoreColumns = new List<string>();
if (pk.Any())
{
ignoreColumns.AddRange(pk.Select(it=>it.PropertyName));
}
x.AsUpdateable.IgnoreColumns(ignoreColumns.ToArray()).ExecuteCommand();
}
else else
{ {
x.AsUpdateable.ExecuteCommand(); x.AsUpdateable.ExecuteCommand();