From 7bb6481df394b2c3aa575c505274f2310e6314c0 Mon Sep 17 00:00:00 2001 From: "Jeremy D. Miller" Date: Wed, 21 Feb 2024 14:40:37 -0600 Subject: [PATCH] Some LINQ fixes and tests to verify the Where(x => false) usage. --- Directory.Build.props | 2 +- ...Bug_using_literal_false_in_where_clause.cs | 24 ++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1fb6987d34..5fe44ca87d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 7.0.0-rc.1 + 7.0.0-rc.2 12.0 Jeremy D. Miller;Babu Annamalai;Oskar Dudycz;Joona-Pekka Kokko https://martendb.io/logo.png diff --git a/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs b/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs index 1ce248f3d2..4d94194330 100644 --- a/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs +++ b/src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs @@ -19,10 +19,32 @@ public Bug_using_literal_false_in_where_clause(ITestOutputHelper output) } [Fact] - public async Task return_correct_results() + public async Task query_soft_deleted_and_false() { + var aggregate1 = new DeletableAggregate + { + Id = Guid.NewGuid(), + Deleted = true, + }; + + theSession.Store(aggregate1); + var aggregate2 = new DeletableAggregate + { + Id = Guid.NewGuid(), + Deleted = false, + }; + + theSession.Store(aggregate2); + await theSession.SaveChangesAsync(); + var actual = await theSession.Query().Where(x => false).ToListAsync(); + actual.ShouldBeEmpty(); + } + + [Fact] + public async Task return_correct_results() + { var aggregate1 = new DeletableAggregate { Id = Guid.NewGuid(),