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

Handle NewArrayExpression in entity equality #18296

Merged
merged 1 commit into from
Oct 14, 2019

Conversation

roji
Copy link
Member

@roji roji commented Oct 9, 2019

Fixes #17744

@smitpatel the fix here is trivial/minimal to unblock the issue for 3.1: the EE visitor simply ignores (unwraps) entity reference node coming up from the NewArray's expressions.

A more complete fix would be to actually bubble this information up (probably all expressions must bubble up the same thing, or we start tracking information per element, like we do for anonymous objects). However, unless I'm mistaken, there's not actually much (anything?) that can be composed over this which EF Core can actually translate. For example, we don't support subscripting the array just created or anything similar, so there doesn't seem to be any value in this (right now).

Let me know if this sounds reasonable and if you'd like me to do something more on this.

Copy link
Contributor

@smitpatel smitpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we don't compose over it so we don't need to flow information out. At least for now. If you can think of any other Visit* method we need to override to make sure unwrapping is happening...

@roji
Copy link
Member Author

roji commented Oct 9, 2019

Thanks.

I know that these bugs are cropping up every now and then because of yet another unhansled expression type (partially because of me still discovering the corners of the expression tree works). I will try to sit down for 3.1 and exhaustively go over all possible types and confirm that everything is handled (will open an issue tomorrow).

@roji roji force-pushed the EntityTypesInObjectArrays branch from e773999 to a1b20fb Compare October 14, 2019 12:45
@roji roji marked this pull request as ready for review October 14, 2019 13:52
@roji roji merged commit 59fbd88 into release/3.1 Oct 14, 2019
@roji roji deleted the EntityTypesInObjectArrays branch October 14, 2019 13:52
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.

Entity objects cannot be returned within arrays in EF 3.0 preview 9
2 participants