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: Incorrectly ignored include with GroupBy #11914

Closed
smitpatel opened this issue May 4, 2018 · 2 comments
Closed

Query: Incorrectly ignored include with GroupBy #11914

smitpatel opened this issue May 4, 2018 · 2 comments

Comments

@smitpatel
Copy link
Member

    public class Blog
    {
        public int Id { get; set; }
        public string Author { get; set; }
        public List<Post> Posts { get; set; }
    }

    public class Post
    {
        public int Id { get; set; }
    }

Query

    var query = db.Blogs.Include(b => b.Posts)
        .GroupBy(b => new { b.Id, b.Author })
        .GroupBy(b => b.Key.Author)
        .ToList();

Generates

warn: Microsoft.EntityFrameworkCore.Query[10106]
      The Include operation for navigation '[b].Posts' is unnecessary and was ignored because the navigation is not reachable in the final query results. See https://go.microsoft.com/fwlink/?linkid=850303 for more information.

But the result does contain Blog and posts should be populated.
EFCore 2.0.2/2.1.0-rc1

@ajcvickers ajcvickers added this to the 2.2.0 milestone May 7, 2018
@ajcvickers ajcvickers modified the milestones: 2.2.0, Backlog Jun 5, 2018
@AndriySvyryd AndriySvyryd added the verify-fixed This issue is likely fixed in new query pipeline. label Aug 22, 2019
@ajcvickers ajcvickers modified the milestones: Backlog, 3.1.0 Sep 4, 2019
@smitpatel smitpatel removed the verify-fixed This issue is likely fixed in new query pipeline. label Sep 12, 2019
@smitpatel
Copy link
Member Author

Blocked on #17068

@smitpatel smitpatel modified the milestones: 3.1.0, Backlog Sep 12, 2019
@smitpatel
Copy link
Member Author

As per #17068 not supported query.

@smitpatel smitpatel removed this from the Backlog milestone Nov 22, 2019
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants