Closed Kirill-Maurin closed 1 month ago
Any version details? And maybe you can post SQL?
Versions:
<PackageReference Include="linq2db.EntityFrameworkCore" Version="3.6.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.7" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
SQL 1:
info: LinqToDB[49]
BeforeExecute
-- PostgreSQL.9.5 PostgreSQL
SELECT
t1.id,
t1.master_id,
t1.name,
"a_Master".id,
"a_Master".name
FROM
details t1
INNER JOIN entitites "a_Master" ON t1.master_id = "a_Master".id
SQL 2:
info: LinqToDB[49]
BeforeExecute
-- PostgreSQL.9.5 PostgreSQL
SELECT
t1.id,
t1.master_id,
t1.name,
"a_Master".id,
"a_Master".name
FROM
details t1
INNER JOIN entitites "a_Master" ON t1.master_id = "a_Master".id
@Kirill-Maurin, linq2db does not have ChangeTracker and Identity Management. So it is expected behavior. When you enable Track changes, we use EF Core's Change Tracker, which knows about loaded entities.
This is expected behavior. As[No]Tracking
is EF.Core method, which checks that it is applied to efcore's IQueryable
and if not - it does nothing. Meaning it does nothing when called after ToLinq2Db
call
Steps:
Expected result: resul of 1 == result of 2
Actual result: result of 1 duplicates same master records in memory for all details
Sample: https://github.com/Kirill-Maurin/linq2db.Sample/blob/a8c2561e379163915a4925e5a2aa91228170548f/linq2db.Sample.Tests/IdTests.cs#L140