Mid
From PDF
EF Core
Entity Framework Core
How to disable change tracking globally?
Short answer: You can disable tracking by default for a specific DbContext using: optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTrac king); Or per-query using .AsNoTracking().
Real-world example (ShopNest)
Read-only catalog pages use AsNoTracking() so EF Core does not spend time snapshotting entities you will never update.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png