Skip to content

Commit aafb6c9

Browse files
Copilotrenemadsen
andcommitted
Add IsValidSelectExpressionForExecuteDelete and clean up imports
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent d0ed930 commit aafb6c9

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/EFCore.MySql/Query/Internal/MySqlQueryableMethodTranslatingExpressionVisitor.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Licensed under the MIT. See LICENSE in the project root for license information.
33

44
using System;
5-
using System.Collections.Generic;
6-
using System.Diagnostics;
75
using System.Diagnostics.CodeAnalysis;
86
using System.Linq;
97
using System.Linq.Expressions;
@@ -82,6 +80,18 @@ bool IsJsonEachKeyColumn(SelectExpression selectExpression, ColumnExpression ord
8280
&& IsJsonEachKeyColumn(subquery, projectedColumn)));
8381
}
8482

83+
protected override bool IsValidSelectExpressionForExecuteDelete(SelectExpression selectExpression)
84+
=> selectExpression is
85+
{
86+
Orderings: [],
87+
Offset: null,
88+
Limit: null,
89+
GroupBy: [],
90+
Having: null
91+
} &&
92+
selectExpression.Tables[0] is TableExpression &&
93+
selectExpression.Tables.Skip(1).All(t => t is InnerJoinExpression);
94+
8595
protected override bool IsValidSelectExpressionForExecuteUpdate(
8696
SelectExpression selectExpression,
8797
TableExpressionBase targetTable,

0 commit comments

Comments
 (0)