-
-
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.
Better exception for unusable LINQ combination. Closes GH-2649
- Loading branch information
1 parent
4d97010
commit 2c8ef2c
Showing
6 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
src/LinqTests/Bugs/Bug_2649_select_and_distinct_string_with_ordering.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,30 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Marten; | ||
using Marten.Exceptions; | ||
using Marten.Testing.Documents; | ||
using Marten.Testing.Harness; | ||
using Shouldly; | ||
|
||
namespace LinqTests.Bugs; | ||
|
||
public class Bug_2649_select_and_distinct_string_with_ordering : BugIntegrationContext | ||
{ | ||
[Fact] | ||
public async Task can_query_with_this_combination() | ||
{ | ||
await theStore.BulkInsertAsync(Target.GenerateRandomData(100).ToArray()); | ||
|
||
var ex = await Should.ThrowAsync<BadLinqExpressionException>(async () => | ||
{ | ||
var query = await theSession.Query<Target>() | ||
.OrderBy(x=> x.String, StringComparer.InvariantCultureIgnoreCase) | ||
.Select(x => x.String) | ||
.Distinct() | ||
.ToListAsync(); | ||
}); | ||
|
||
|
||
} | ||
} |
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
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