Skip to content

Commit 2f1c811

Browse files
author
Bart Koelman
committed
Fixed: suppress unhelpful warning in cibuild log
1 parent e77e2f6 commit 2f1c811

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/TestBuildingBlocks/BaseIntegrationTestContext.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ private WebApplicationFactory<TRemoteStartup> CreateFactory()
7171

7272
services.AddDbContext<TDbContext>(options =>
7373
{
74-
options.UseNpgsql(dbConnectionString);
74+
options.UseNpgsql(dbConnectionString, builder =>
75+
// The next line suppresses EF Core Warning:
76+
// "Compiling a query which loads related collections for more than one collection navigation
77+
// either via 'Include' or through projection but no 'QuerySplittingBehavior' has been configured."
78+
// We'd like to use `QuerySplittingBehavior.SplitQuery` because of improved performance, but unfortunately
79+
// it makes EF Core 5 crash on queries that load related data in a projection without Include.
80+
// This is fixed in EF Core 6, tracked at https://github.com/dotnet/efcore/issues/21234.
81+
builder.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery));
82+
7583
options.EnableSensitiveDataLogging();
7684
options.EnableDetailedErrors();
7785
});

0 commit comments

Comments
 (0)