-
-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat the Identity Field as a Duplicated Field (#2016)
Treat the Identity Field as a Duplicated Field * Add unit test * Treat IdField as DuplicatedField in SimpleEqualsParser
- Loading branch information
1 parent
76e00b7
commit 51e6e0e
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/Marten.Testing/Linq/Bug_id_field_does_not_hit_id_column.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.Linq; | ||
using Marten.Linq; | ||
using Marten.Services; | ||
using Marten.Testing.Documents; | ||
using Marten.Testing.Harness; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace Marten.Testing.Linq | ||
{ | ||
[SelectionStoryteller] | ||
public class Bug_id_field_does_not_hit_id_column: IntegrationContextWithIdentityMap<NulloIdentityMap> | ||
{ | ||
[Fact] | ||
public void return_the_correct_number_of_results() | ||
{ | ||
var target = new Target | ||
{ | ||
Id = System.Guid.NewGuid() | ||
}; | ||
|
||
theStore.BulkInsert(new[] { target }); | ||
|
||
var queryable = theSession.Query<Target>() | ||
.Where(x => x.Id == target.Id); | ||
|
||
var cmd = queryable.ToCommand(FetchType.FetchMany); | ||
|
||
SpecificationExtensions.ShouldContain(cmd.CommandText, "where d.id = :arg0"); | ||
|
||
queryable.ToArray().Length.ShouldBe(1); | ||
} | ||
|
||
public Bug_id_field_does_not_hit_id_column(DefaultStoreFixture fixture) : base(fixture) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters