Skip to content

Commit

Permalink
Some LINQ fixes and tests to verify the Where(x => false) usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Feb 21, 2024
1 parent da37afa commit 7bb6481
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<VersionPrefix>7.0.0-rc.1</VersionPrefix>
<VersionPrefix>7.0.0-rc.2</VersionPrefix>
<LangVersion>12.0</LangVersion>
<Authors>Jeremy D. Miller;Babu Annamalai;Oskar Dudycz;Joona-Pekka Kokko</Authors>
<PackageIconUrl>https://martendb.io/logo.png</PackageIconUrl>
Expand Down
24 changes: 23 additions & 1 deletion src/LinqTests/Bugs/Bug_using_literal_false_in_where_clause.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DeletableAggregate>().Where(x => false).ToListAsync();

actual.ShouldBeEmpty();
}

[Fact]
public async Task return_correct_results()
{
var aggregate1 = new DeletableAggregate
{
Id = Guid.NewGuid(),
Expand Down

0 comments on commit 7bb6481

Please sign in to comment.