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

Query: InMemory throws "nullable object must have a value" for queries projecting into anonymous type via optional navigation #18284

Closed
maumar opened this issue Oct 8, 2019 · 1 comment · Fixed by #23216
Assignees
Labels
area-in-memory area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@maumar
Copy link
Contributor

maumar commented Oct 8, 2019

query:

ss.Set<CogTag>()
    .GroupBy(t => new { t.Gear.HasSoulPatch, t.Gear.Squad.Name })
    .Select(g => new { g.Key.HasSoulPatch, Name = g.Key.Name.ToLower() })

when we translate key selector its in a form of [Microsoft.EntityFrameworkCore.Query.EntityShaperExpression].HasSoulPatch

EntityShaper gets converted to EntityProjectionExpression but we don't check if it was nullable - we should, and if so add null propagation to the member access

@maumar maumar added type-bug and removed type-bug labels Oct 8, 2019
@maumar maumar self-assigned this Oct 8, 2019
@ajcvickers ajcvickers added this to the Backlog milestone Oct 10, 2019
@maumar
Copy link
Contributor Author

maumar commented Feb 26, 2020

Also applies to nullable columns typed to non-nullable (inside predicate)

@ajcvickers ajcvickers modified the milestones: Backlog, 6.0.0 Nov 5, 2020
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 6, 2020
@smitpatel smitpatel assigned smitpatel and unassigned maumar Nov 6, 2020
@ghost ghost closed this as completed in #23216 Nov 6, 2020
ghost pushed a commit that referenced this issue Nov 6, 2020
@ajcvickers ajcvickers modified the milestones: 6.0.0, 6.0.0-preview1 Jan 27, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0-preview1, 6.0.0 Nov 8, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-in-memory area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants