Skip to content

Commit

Permalink
Removed workaround for dotnet/efcore#21234
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Koelman committed Dec 3, 2021
1 parent 4ea4edc commit f15050b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions test/TestBuildingBlocks/IntegrationTestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,7 @@ private WebApplicationFactory<TStartup> CreateFactory()
services.AddDbContext<TDbContext>(options =>
{
options.UseNpgsql(dbConnectionString, builder =>
// The next line suppresses Entity Framework Core Warning:
// "Compiling a query which loads related collections for more than one collection navigation
// either via 'Include' or through projection but no 'QuerySplittingBehavior' has been configured."
// We'd like to use `QuerySplittingBehavior.SplitQuery` because of improved performance, but unfortunately
// it makes Entity Framework Core 5 crash on queries that load related data in a projection without Include.
// This is fixed in Entity Framework Core 6, tracked at https://github.com/dotnet/efcore/issues/21234.
builder.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery));
options.UseNpgsql(dbConnectionString, builder => builder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery));
#if DEBUG
options.EnableSensitiveDataLogging();
Expand Down

0 comments on commit f15050b

Please sign in to comment.