- 修复 Delete.Where in 查询为空时,异步操作仍然执行删除;#1068

This commit is contained in:
2881099 2022-04-12 18:28:55 +08:00
parent a01478b4b4
commit 0387c0a4cf
2 changed files with 3 additions and 1 deletions

View File

@ -77,6 +77,8 @@ namespace FreeSql.Tests.SqliteExpression
{ {
IEnumerable<int> testlinqlist = new List<int>(new[] { 1, 2, 3 }); IEnumerable<int> testlinqlist = new List<int>(new[] { 1, 2, 3 });
var testlinq = select.Where(a => testlinqlist.Contains(a.Int)).ToList(); var testlinq = select.Where(a => testlinqlist.Contains(a.Int)).ToList();
var testlinq2list = new string[] { };
var testlinq2 = g.sqlite.Delete<TableAllType>().Where(a => testlinq2list.Contains(a.String)).ToSql();
//in not in //in not in
var sql111 = select.Where(a => new[] { 1, 2, 3 }.Contains(a.Int)).ToList(); var sql111 = select.Where(a => new[] { 1, 2, 3 }.Contains(a.Int)).ToList();

View File

@ -239,7 +239,7 @@ namespace FreeSql.Internal.CommonProvider
return; return;
} }
sb.Insert(0, _commonUtils.QuoteSqlName(TableRuleInvoke())).Insert(0, "DELETE FROM "); sb.Append("DELETE FROM ").Append(_commonUtils.QuoteSqlName(TableRuleInvoke())).Append(newwhere);
_interceptSql?.Invoke(sb); _interceptSql?.Invoke(sb);
await fetchAsync(sb); await fetchAsync(sb);
sb.Clear(); sb.Clear();