- 优化 IInsertOrUpdate SetSource tempPrimary 自增的忽略保存;

This commit is contained in:
2881099
2023-03-03 19:00:52 +08:00
parent 50decde891
commit b8c798e292
20 changed files with 70 additions and 48 deletions

View File

@ -57,7 +57,7 @@ namespace FreeSql.Odbc.PostgreSQL
{
var ocdu = new OdbcPostgreSQLOnConflictDoUpdate<T1>(insert.InsertIdentity());
ocdu._tempPrimarys = _tempPrimarys;
var cols = _table.Columns.Values.Where(a => _tempPrimarys.Contains(a) == false && a.Attribute.CanUpdate == true && _updateIgnore.ContainsKey(a.Attribute.Name) == false);
var cols = _table.Columns.Values.Where(a => _tempPrimarys.Contains(a) == false && a.Attribute.CanUpdate == true && a.Attribute.IsIdentity == false && _updateIgnore.ContainsKey(a.Attribute.Name) == false);
ocdu.UpdateColumns(cols.Select(a => a.Attribute.Name).ToArray());
if (_doNothing == true || cols.Any() == false)
ocdu.DoNothing();