-
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
Query: Tuples are not translatable to Sql. Client Eval them #9522
Conversation
var ids = new[] { Tuple.Create(1, 2), Tuple.Create(10248, 11) }; | ||
|
||
AssertQuery<OrderDetail>( | ||
cd => cd.Where(c => ids.Contains(new Tuple<int, int>(c.OrderID, c.ProductID))), entryCount: 1); |
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.
cd -> od
c -> od
What happens with normal anonymous type for this test?
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.
It also fails. Needs different solution.
*/ | ||
if ((!expression.Type.IsGenericType | ||
|| !string.Equals(expression.Type.GetGenericTypeDefinition().DisplayName(), typeof(Tuple).DisplayName())) | ||
&& expression.Members != null |
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.
Can we do the anonymous type expansion?
f990d92
to
06aeff6
Compare
Updated |
@@ -907,7 +907,7 @@ protected override Expression VisitSubQuery(SubQueryExpression expression) | |||
|| fromExpression.NodeType == ExpressionType.NewArrayInit) | |||
{ | |||
var containsItem = Visit(contains.Item)?.RemoveConvert(); | |||
if (containsItem != null) | |||
if (containsItem != null && !containsItem.Type.Equals(typeof(Expression[]))) |
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.
==
… not translatable to server Fixes #9424
06aeff6
to
ccb6a27
Compare
Added more tests. We are not translating equality in Where for anonymous/tuple. |
@anpete - Ping! |
Fixes #9424