File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,15 @@ private WebApplicationFactory<TRemoteStartup> CreateFactory()
71
71
72
72
services . AddDbContext < TDbContext > ( options =>
73
73
{
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
+
75
83
options . EnableSensitiveDataLogging ( ) ;
76
84
options . EnableDetailedErrors ( ) ;
77
85
} ) ;
You can’t perform that action at this time.
0 commit comments