Skip to content
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

Fix to #6937 - Query: Contains on element coming from optional navigation doesn't get server-evaluated #6998

Closed
wants to merge 1 commit into from

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Nov 11, 2016

Problem was that when trying to translate contains ResultOperator we assumed that the translatable expression would always be member access or a EF.Property method call.
However in some cases (e.g. when item is part of an optional navigation) this is not the case, and the underlying member/EF.Property is wrapped around Convert and/or NullConditional.
Fix is to perform translation on the item before before checking what shape it is. This simplifies the code and protects from similar situations, because SqlTranslatingExpressionVisitor already optimizes out a lot of redundant nodes in the expression tree.

@maumar
Copy link
Contributor Author

maumar commented Nov 11, 2016

@anpete @smitpatel

…tion doesn't get server-evaluated

Problem was that when trying to translate contains ResultOperator we assumed that the translatable expression would always be member access or a EF.Property method call.
However in some cases (e.g. when item is part of an optional navigation) this is not the case, and the underlying member/EF.Property is wrapped around Convert and/or NullConditional.
Fix is to perform translation on the item before before checking what shape it is. This simplifies the code and protects from similar situations, because SqlTranslatingExpressionVisitor already optimizes out a lot of redundant nodes in the expression tree.
@maumar
Copy link
Contributor Author

maumar commented Nov 15, 2016

merged in 8965903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants