change tracking
EF Core keeping a snapshot of entities it loaded so that SaveChanges can detect which properties changed and send updates for them.
In more detail
Tracking is what lets you load an entity, change a property and save. For read-only queries, AsNoTracking avoids the snapshot cost.
Related terms
- DbContext — The EF Core class that represents a session with the database: it tracks entities, translates queries and saves changes as one unit of work.
- AsNoTracking — An EF Core query method that returns entities without tracking them, for results you will only read.
- SaveChanges — The DbContext method that writes all tracked inserts, updates and deletes to the database in one transaction.
Taught in
- Classes, Interfaces, and Object-Oriented C# — Modern .NET Core, C# & Enterprise Microservices
- Entity Framework Core: Code First and Migrations — Modern .NET Core, C# & Enterprise Microservices
- Querying, Change Tracking, and Saving Data — Modern .NET Core, C# & Enterprise Microservices
- The Repository Pattern — Modern .NET Core, C# & Enterprise Microservices