Explain AsNoTracking and when to use it.
Updated Apr 28, 2026
Short answer
AsNoTracking tells EF Core not to track the results of a query in the Change Tracker, saving memory and improving read performance.
Deep explanation
By default, EF Core tracks all entities returned from queries to support future updates. If you only intend to display data (read-only operations), the tracking overhead is unnecessary. Using .AsNoTracking() bypasses the Identity Map, making queries significantly faster.
Real-world example
Fetching a list of products to display on an e-commerce catalog page where no updates will occur.
Common mistakes
- Using AsNoTracking, modifying the entity, and expecting SaveChanges() to update the database.
Follow-up questions
- What is AsNoTrackingWithIdentityResolution()?