-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-4872: Add support for Append in aggregate expressions. #1569
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
Conversation
|
This adds support for Append in expressions. It does not add support for top-level IQueryable Append. I'm not sure if there is a good way to support top-level Append in MQL. Perhaps with a |
| else | ||
| { | ||
| elementTranslation = ExpressionToAggregationExpressionTranslator.TranslateEnumerable(context, elementExpression); | ||
| if (!elementTranslation.Serializer.Equals(itemSerializer)) |
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.
Should we check for compatible serializers instead? For example if collection is of long and appended item is int.
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.
That should never happen. By the time we get here both serializers will always have the exact same ValueType.
The only question is whether they are serialized the same way.
|
|
||
| namespace MongoDB.Driver.Tests.Linq.Linq3Implementation.Jira | ||
| { | ||
| public class CSharp4872Tests : Linq3IntegrationTest |
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.
Should I be able to Append int to collection of longs?
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, but...
The compiler will insert a Convert from int to long so in the end you are actually appending a long.
sanych-sun
left a comment
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.
LGTM
sanych-sun
left a comment
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.
LGTM
No description provided.