Skip to content

Query with null-coalesced entity gets client-evaluated #13568

Description

@Wain123

This query throws a QueryClientEvaluationWarning:

Blog a = ctx.Blogs.First();
Blog b = a;
ctx.Posts.Where(p => p.Blog == (a ?? b)).Count();

As a workaround, I can compare the PK instead of the navigation:

decimal? a = ctx.Blogs.First().Seqnr;
decimal? b = a;
ctx.Posts.Where(p => p.Blog.Seqnr == (a ?? b)).Count();

EF Core version: 2.1.1
Database Provider: Microsoft.EntityFrameworkCore.Oracle
Operating system: Windows 10
IDE: Visual Studio Professional 2017 15.8.6

Activity

  1. added this to the 3.0.0 milestone on Oct 12, 2018
  2. modified the milestones: 3.0.0, Backlog on Jan 24, 2019
  3. removed their assignment
    on Jan 29, 2019
  4. self-assigned this
    on Mar 16, 2020
  5. smitpatel commented on Mar 16, 2020

    @smitpatel
    Contributor

    Related #20164

  6. modified the milestones: Backlog, 5.0.0 on Mar 28, 2020
  7. added 4 commits that reference this issue on Mar 28, 2020
    24718b0
    ba04dd0
    904a105
    b7360ca
  8. added a commit that references this issue on Mar 31, 2020
    bb88898
  9. modified the milestones: 5.0.0, on Mar 31, 2020
  10. modified the milestones: , 5.0.0 on Apr 1, 2020
  11. modified the milestones: 5.0.0, on Apr 20, 2020
  12. modified the milestones: , 5.0.0 on Nov 7, 2020
  13. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions