- 优化 IUpdate.Set 字符串累加本身为 NULL 的情况;#1209

This commit is contained in:
2881099
2022-08-09 19:21:22 +08:00
parent f042ea46bb
commit efc454b817
2 changed files with 8 additions and 0 deletions

View File

@ -622,6 +622,11 @@ namespace FreeSql.Internal.CommonProvider
if (replval == null) continue;
var replname = _commonUtils.QuoteSqlName(col.Column.Attribute.Name);
expt = expt.Replace(replname, _commonUtils.IsNull(replname, _commonUtils.FormatSql("{0}", replval)));
}
else if (col.Column.CsType == typeof(string))
{
var replname = _commonUtils.QuoteSqlName(col.Column.Attribute.Name);
expt = expt.Replace(replname, _commonUtils.IsNull(replname, _commonUtils.FormatSql("{0}", "")));
}
}
_setIncr.Append(", ").Append(_commonUtils.QuoteSqlName(cols.First().Column.Attribute.Name)).Append(" = ").Append(expt);