-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle shadow navigations when loading with split queries
Fixes #32225
- Loading branch information
1 parent
1b59013
commit 6d37cfe
Showing
7 changed files
with
68 additions
and
2 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
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
23 changes: 23 additions & 0 deletions
23
test/EFCore.Sqlite.FunctionalTests/Query/ManyToManyNoTrackingSplitQuerySqliteTest.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,23 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.EntityFrameworkCore.Sqlite.Internal; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Query; | ||
|
||
public class ManyToManyNoTrackingSplitQuerySqliteTest | ||
: ManyToManyNoTrackingQueryRelationalTestBase<ManyToManySplitQuerySqliteFixture> | ||
{ | ||
public ManyToManyNoTrackingSplitQuerySqliteTest(ManyToManySplitQuerySqliteFixture fixture) | ||
: base(fixture) | ||
{ | ||
} | ||
|
||
// Sqlite does not support Apply operations | ||
|
||
public override async Task Skip_navigation_order_by_single_or_default(bool async) | ||
=> Assert.Equal( | ||
SqliteStrings.ApplyNotSupported, | ||
(await Assert.ThrowsAsync<InvalidOperationException>( | ||
() => base.Skip_navigation_order_by_single_or_default(async))).Message); | ||
} |
13 changes: 13 additions & 0 deletions
13
test/EFCore.Sqlite.FunctionalTests/Query/ManyToManySplitQuerySqliteFixture.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,13 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Query; | ||
|
||
public class ManyToManySplitQuerySqliteFixture : ManyToManyQuerySqliteFixture | ||
{ | ||
protected override string StoreName | ||
=> "ManyToManySplitQuery"; | ||
|
||
public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) | ||
=> base.AddOptions(builder.UseSqlite(b => b.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery))); | ||
} |
20 changes: 20 additions & 0 deletions
20
test/EFCore.Sqlite.FunctionalTests/Query/ManyToManySplitQuerySqliteTest.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,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using Microsoft.EntityFrameworkCore.Sqlite.Internal; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Query; | ||
|
||
public class ManyToManySplitQuerySqliteTest : ManyToManyQueryRelationalTestBase<ManyToManySplitQuerySqliteFixture> | ||
{ | ||
public ManyToManySplitQuerySqliteTest(ManyToManySplitQuerySqliteFixture fixture) | ||
: base(fixture) | ||
{ | ||
} | ||
|
||
public override async Task Skip_navigation_order_by_single_or_default(bool async) | ||
=> Assert.Equal( | ||
SqliteStrings.ApplyNotSupported, | ||
(await Assert.ThrowsAsync<InvalidOperationException>( | ||
() => base.Skip_navigation_order_by_single_or_default(async))).Message); | ||
} |