mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 修复 WithMemory 对 InsertValueSql 属性无效的问题;
This commit is contained in:
@ -264,7 +264,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
return this;
|
||||
}
|
||||
|
||||
public void WriteSourceSelectUnionAll(List<T1> source, StringBuilder sb, List<DbParameter> dbParams)
|
||||
public void WriteSourceSelectUnionAll(List<T1> source, StringBuilder sb, List<DbParameter> dbParams, bool disableInsertValueSql = false)
|
||||
{
|
||||
if (_sourceSql != null)
|
||||
{
|
||||
@ -287,7 +287,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
foreach (var col in _table.Columns.Values)
|
||||
{
|
||||
if (colidx2 > 0) sb.Append(", ");
|
||||
if (string.IsNullOrEmpty(col.DbInsertValue) == false)
|
||||
if (disableInsertValueSql == false && string.IsNullOrEmpty(col.DbInsertValue) == false)
|
||||
sb.Append(col.DbInsertValue);
|
||||
else
|
||||
{
|
||||
|
@ -529,7 +529,7 @@ namespace FreeSql.Internal.CommonProvider
|
||||
if (list.Any() != true) throw new Exception(CoreStrings.Cannot_Be_NULL_Name(nameof(source)));
|
||||
var sb = new StringBuilder();
|
||||
(_orm.InsertOrUpdate<object>().AsType(_tables[0].Table.Type) as InsertOrUpdateProvider<object>)
|
||||
.WriteSourceSelectUnionAll(list, sb, _params);
|
||||
.WriteSourceSelectUnionAll(list, sb, _params, true);
|
||||
|
||||
try { return WithSql(sb.ToString()); }
|
||||
finally { sb.Clear(); }
|
||||
|
Reference in New Issue
Block a user