AsNoTracking
An EF Core query method that returns entities without tracking them, for results you will only read.
In more detail
EF Core normally tracks every entity it loads so it can detect changes later. It saves memory and time on reads, but an untracked entity is not updated by changing a property and calling SaveChanges.
Related terms
- change tracking — EF Core keeping a snapshot of entities it loaded so that SaveChanges can detect which properties changed and send updates for them.
- projection — Choosing which fields or columns a query returns, or reshaping each result into a different form.
Taught in
- Querying, Change Tracking, and Saving Data — Modern .NET Core, C# & Enterprise Microservices