Skip to content

Query: Translate Exists #9295

@smitpatel

Description

@smitpatel
var query = db.Blogs.FirstOrDefault(b => b.Posts.Any(p => p.Name == "test"));

Translate to

      SELECT TOP(1) [b].[Id]
      FROM [Blogs] AS [b]
      WHERE EXISTS (
          SELECT 1
          FROM [Post] AS [p]
          WHERE ([p].[Name] = N'test') AND ([b].[Id] = [p].[BlogId]))

But

var query = db.Blogs.FirstOrDefault(b => b.Posts.Exists(p => p.Name == "test"));

client evals. 🤦‍♂️

Metadata

Metadata

Assignees

Labels

good first issueThis issue should be relatively straightforward to fix.help wantedThis issue involves technologies where we are not experts. Expert help would be appreciated.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions