efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Turn Tracking by global to off? : Question

Open neridonk opened this issue 10 years ago • 2 comments

Is it possible to change Tracking global to off so that I dont have to call the methode AsNoTracking() on every "get" call

neridonk avatar Mar 10 '16 09:03 neridonk

+1

HalidCisse avatar Mar 11 '16 01:03 HalidCisse

There is a DbContext.ChangeTracker.QueryTrackingBehavior property. If you want no tracking by default, then you can set it to QueryTrackingBehavior.NoTracking in the context constructor.

rowanmiller avatar Mar 21 '16 22:03 rowanmiller