Skip to content

IQueryable.All evaluate to false with predicate _ => true #23617

@tomek-anuszkiewicz

Description

@tomek-anuszkiewicz

IQueryable.All evaluate to false with predicate _ => true

With https://github.com/dotnet/EntityFramework.Docs/tree/master/samples/core/GetStarted
Modify Program.cs like:

using (var db = new BloggingContext())
{
    db.Database.Migrate();

    // Create
    Console.WriteLine("Inserting a new blog");
    db.Add(new Blog { Url = "http://blogs.msdn.com/adonet" });
    db.SaveChanges();

    if (db.Blogs.ToList().All(_ => true) != db.Blogs.All(_ => true))
        throw new Exception("Why?");
}

Shouldn't Blogs.All(_ => true) evaluate to true like db.Blogs.ToList().All(_ => true)?

EF Core version: 5
Database provider: Sqlite
Target framework: NET5
Operating system: Windows
IDE: VS2019

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions