-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query: Lift Subqueries when outer QM's select can be pushed down into…
… subqueryQM Apply QueryOptimizer recursively on all QueryModels Introduce SubQueryExpressionVisitor<IQueryModelVisitor> to apply QMV's recursively.
- Loading branch information
Showing
7 changed files
with
159 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/EFCore/Query/ExpressionVisitors/Internal/TransformingQueryModelExpressionVisitor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Linq.Expressions; | ||
using JetBrains.Annotations; | ||
using Microsoft.EntityFrameworkCore.Utilities; | ||
using Remotion.Linq; | ||
using Remotion.Linq.Clauses.Expressions; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal | ||
{ | ||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
public class TransformingQueryModelExpressionVisitor<TVisitor> : ExpressionVisitorBase | ||
where TVisitor : IQueryModelVisitor | ||
{ | ||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
protected virtual TVisitor TransformingQueryModelVisitor { get; } | ||
|
||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
public TransformingQueryModelExpressionVisitor([NotNull] TVisitor transformingQueryModelVisitor) | ||
{ | ||
Check.NotNull(transformingQueryModelVisitor, nameof(transformingQueryModelVisitor)); | ||
|
||
TransformingQueryModelVisitor = transformingQueryModelVisitor; | ||
} | ||
|
||
/// <summary> | ||
/// This API supports the Entity Framework Core infrastructure and is not intended to be used | ||
/// directly from your code. This API may change or be removed in future releases. | ||
/// </summary> | ||
protected override Expression VisitSubQuery(SubQueryExpression expression) | ||
{ | ||
TransformingQueryModelVisitor.VisitQueryModel(expression.QueryModel); | ||
|
||
return base.VisitSubQuery(expression); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.