Open
Description
Queries of the form
...
.Take()
.Include().ThenInclude()
are translated the following way:
SELECT ...
FROM (
SELECT ...
FROM (...
) as l
LIMIT... -- Take()
) as t
JOIN ... -- Include() entity
JOIN ... -- ThenInclude() entity
ORDER BY t... l... -- the extra ORDER BY
An additional ORDER BY
overrides any ordering of the most inner FROM (or natural ordering) if it's a raw query.
EF Core version: both 3.1 and 5
Database provider: (tested on PG)
Target framework: .NET Core 3.1