- 优化 ServerTime 与 IUpdate.Set 指定更新的问题;#1251

This commit is contained in:
2881099
2022-09-20 12:23:51 +08:00
parent 0e6945cf76
commit f8f31df120
4 changed files with 93 additions and 3 deletions

View File

@ -6,7 +6,6 @@ using System.Data;
using System.Data.Common;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
@ -1017,9 +1016,15 @@ namespace FreeSql.Internal.CommonProvider
if (_source.Any() == false)
{
var sbString = "";
foreach (var col in _table.Columns.Values)
if (col.Attribute.CanUpdate && string.IsNullOrEmpty(col.DbUpdateValue) == false)
sb.Append(", ").Append(_commonUtils.QuoteSqlName(col.Attribute.Name)).Append(" = ").Append(col.DbUpdateValue);
{
if (sbString == "") sbString = sb.ToString();
var loc3 = _commonUtils.QuoteSqlName(col.Attribute.Name);
if (sbString.Contains(loc3)) continue;
sb.Append(", ").Append(loc3).Append(" = ").Append(col.DbUpdateValue);
}
}
if (_versionColumn != null)