-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port AllAnyToContainsRewritingExpressionVisitor to new pipeline #15806
Conversation
src/EFCore/Query/Pipeline/AllAnyToContainsRewritingExpressionVisitor2.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Pipeline/AllAnyToContainsRewritingExpressionVisitor2.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Pipeline/AllAnyToContainsRewritingExpressionVisitor2.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Pipeline/AllAnyToContainsRewritingExpressionVisitor2.cs
Outdated
Show resolved
Hide resolved
src/EFCore/Query/Pipeline/AllAnyToContainsRewritingExpressionVisitor2.cs
Outdated
Show resolved
Hide resolved
negated = false; | ||
if (mce.Arguments.Count == 1 && mce.Object?.Type == mce.Arguments[0].Type) | ||
{ | ||
(left, right) = (mce.Object, mce.Arguments[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we moving towards python like syntax?
While I am not opposed to this, we should define a consistent guideline as a team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used this ever since the syntax was introduced, to me it makes a lot of sense precisely in cases like this where two separate lines just take up more space without readability value.
Not sure of the process for introducing new style :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just bring up in next meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this a few places and like it, but agree we can discuss. At the same time we can talk about (shuddering to say it ) REGIONS!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've seen some unauthorized regions lurking abut in @smitpatel's new pipeline code...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I was referring to. ;-)
Closes #15717
Functionality pretty close to the old implementation, but generating a Contains() MethodCallExpression directly (no need to go through SubQueryExpression as before).
Note
TryExtractEqualityOperands()
which could be a good candidate for a utility extension - this is probably a healthier/lower-risk approach than early normalization via a visitor.