Better EF Core Performance - Turn off Query Tracking #shorts

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

It's incredibly important to know that doing this will make the standard procedure of: "Fetch data using context. Mutate the fetched data. SaveChanges on context" no longer work. You will then have to add `AsTracking()` on the query.

With the release of EFCore7 I've personally swapped over to using `ExecuteUpdateAsync` more-or-less always as it makes the changes a lot more clear. It also allows you to only do 1 SQL query as well (instead of 2; Fetch & Update)

modernkennnern
Автор

But what about when I need entity framework to track in order for me to do an update?

javiermayorga