-
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: Cleanup regions in Expressions
- Loading branch information
Showing
26 changed files
with
298 additions
and
705 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
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
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
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
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
41 changes: 41 additions & 0 deletions
41
src/EFCore.Relational/Query/Pipeline/SqlExpressions/CrossJoinExpression.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,41 @@ | ||
// 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 Microsoft.EntityFrameworkCore.Query.Internal; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Relational.Query.Pipeline.SqlExpressions | ||
{ | ||
public class CrossJoinExpression : JoinExpressionBase | ||
{ | ||
public CrossJoinExpression(TableExpressionBase table) | ||
: base(table) | ||
{ | ||
} | ||
|
||
protected override Expression VisitChildren(ExpressionVisitor visitor) | ||
=> Update((TableExpressionBase)visitor.Visit(Table)); | ||
|
||
public CrossJoinExpression Update(TableExpressionBase table) | ||
=> table != Table | ||
? new CrossJoinExpression(table) | ||
: this; | ||
|
||
public override void Print(ExpressionPrinter expressionPrinter) | ||
{ | ||
expressionPrinter.StringBuilder.Append("CROSS JOIN "); | ||
expressionPrinter.Visit(Table); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
=> obj != null | ||
&& (ReferenceEquals(this, obj) | ||
|| obj is CrossJoinExpression crossJoinExpression | ||
&& Equals(crossJoinExpression)); | ||
|
||
private bool Equals(CrossJoinExpression crossJoinExpression) | ||
=> base.Equals(crossJoinExpression); | ||
|
||
public override int GetHashCode() => base.GetHashCode(); | ||
} | ||
} |
Oops, something went wrong.