Skip to content

Commit 080a940

Browse files
Copilotrenemadsen
andcommitted
Fix CS0672 and related compilation errors for EF Core API changes
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent 177bc1e commit 080a940

File tree

3 files changed

+16
-49
lines changed

3 files changed

+16
-49
lines changed

src/EFCore.MySql/Query/ExpressionVisitors/Internal/MySqlBoolOptimizingExpressionVisitor.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,20 @@ protected override Expression VisitLeftJoin(LeftJoinExpression leftJoinExpressio
541541
return leftJoinExpression.Update(table, joinPredicate);
542542
}
543543

544+
protected override Expression VisitRightJoin(RightJoinExpression rightJoinExpression)
545+
{
546+
Check.NotNull(rightJoinExpression, nameof(rightJoinExpression));
547+
548+
var parentOptimize = _optimize;
549+
_optimize = false;
550+
var table = (TableExpressionBase)Visit(rightJoinExpression.Table);
551+
_optimize = true;
552+
var joinPredicate = (SqlExpression)Visit(rightJoinExpression.JoinPredicate);
553+
_optimize = parentOptimize;
554+
555+
return rightJoinExpression.Update(table, joinPredicate);
556+
}
557+
544558
protected override Expression VisitRowValue(RowValueExpression rowValueExpression)
545559
{
546560
var parentOptimize = _optimize;

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#nullable enable
55

6+
using System;
67
using System.Collections.Generic;
78
using System.Linq.Expressions;
89
using Microsoft.EntityFrameworkCore.Query;
@@ -25,6 +26,7 @@ public MySqlParameterBasedSqlProcessor(
2526
_options = options;
2627
}
2728

29+
[Obsolete]
2830
public override Expression Optimize(
2931
Expression queryExpression,
3032
IReadOnlyDictionary<string, object?> parametersValues,
@@ -58,20 +60,5 @@ public override Expression Optimize(
5860

5961
return queryExpression;
6062
}
61-
62-
/// <inheritdoc />
63-
protected override Expression ProcessSqlNullability(
64-
Expression queryExpression,
65-
IReadOnlyDictionary<string, object?> parametersValues,
66-
out bool canCache)
67-
{
68-
Check.NotNull(queryExpression, nameof(queryExpression));
69-
Check.NotNull(parametersValues, nameof(parametersValues));
70-
71-
queryExpression = new MySqlSqlNullabilityProcessor(Dependencies, Parameters)
72-
.Process(queryExpression, parametersValues, out canCache);
73-
74-
return queryExpression;
75-
}
7663
}
7764
}

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -80,40 +80,6 @@ bool IsJsonEachKeyColumn(SelectExpression selectExpression, ColumnExpression ord
8080
&& IsJsonEachKeyColumn(subquery, projectedColumn)));
8181
}
8282

83-
protected override bool IsValidSelectExpressionForExecuteDelete(
84-
SelectExpression selectExpression,
85-
StructuralTypeShaperExpression shaper,
86-
[NotNullWhen(true)] out TableExpression tableExpression)
87-
{
88-
if (selectExpression.Offset == null
89-
&& selectExpression.GroupBy.Count == 0
90-
&& selectExpression.Having == null
91-
&& (selectExpression.Tables.Count == 1 || selectExpression.Orderings.Count == 0))
92-
{
93-
TableExpressionBase table;
94-
if (selectExpression.Tables.Count == 1)
95-
{
96-
table = selectExpression.Tables[0];
97-
}
98-
else
99-
{
100-
var projectionBindingExpression = (ProjectionBindingExpression)shaper.ValueBufferExpression;
101-
var entityProjectionExpression = (StructuralTypeProjectionExpression)selectExpression.GetProjection(projectionBindingExpression);
102-
var column = entityProjectionExpression.BindProperty(shaper.StructuralType.GetProperties().First());
103-
table = selectExpression.GetTable(column).UnwrapJoin();
104-
}
105-
106-
if (table is TableExpression te)
107-
{
108-
tableExpression = te;
109-
return true;
110-
}
111-
}
112-
113-
tableExpression = null;
114-
return false;
115-
}
116-
11783
protected override bool IsValidSelectExpressionForExecuteUpdate(
11884
SelectExpression selectExpression,
11985
TableExpressionBase targetTable,

0 commit comments

Comments
 (0)