
▲ 3 r/dotnet
Wrote up the three EF Core patterns I see most often during code reviews — N+1 hiding behind projections, cartesian explosions from stacked Includes, and change tracker leaks in long-running jobs.
Tried to make it the kind of post I wished existed when I first hit these. Each bug shows the actual SQL EF generates so you can see why the fix works, not just take my word for it. Covers EF Core 8, 9, and 10.
Curious whether others have run into the AutoMapper ProjectTo gotcha — that one took me longest to track down the first time.
u/EastBlacksmith4601 — 14 days ago