Mid EF Core

How to disable change tracking globally?

You can disable tracking by default for a specific DbContext using:

optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTrac

king);

Or per-query using .AsNoTracking().

More from Entity Framework Core Tutorial

All questions for this course