Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
779 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I recently upgraded a .NET core 2.1 web app to .NET 7 with upgrading EntityFrameworkCore to 7.0.1.
a statement that use "Include" is now producing Sql queries with LEFT JOIN whereas with 2.1, they produce a mix of LEFT and INNER joins.
_dbContext.T1
.Include(t11 => t11.T11)
.ThenInclude(t12 => t12.T12)
.Include(p => p.P)
.AsNoTracking()
produces
2.1 :
FROM T12
INNER JOIN (
SELECT DISTINCT ..................
FROM T11
INNER JOIN (
SELECT ......
FROM T1
LEFT JOIN P .........................
7 :
FROM T1
LEFT JOIN P
LEFT JOIN (
SELECT ------
FROM T11
LEFT JOIN T12
-----
Wonder why the latest EFCore 7 produces a different SQL query to 2.1
I was expecting the generated SQL to be the same in both version of EFCore