Efcore: How to disable tracking and validation?

Created on 29 Jan 2016  路  3Comments  路  Source: dotnet/efcore

How do I do this in EF 7?

c# context.Configuration.AutoDetectChangesEnabled = false; context.Configuration.ValidateOnSaveEnabled = false;

Most helpful comment

Validation does not exist in EF Core (formerly EF7), so no need to change that one.

context.ChangeTracker.AutoDetectChangesEnabled is the one you are after, though we do this a lot less often in EF Core... so you shouldn't need to switch it off in most cases.

All 3 comments

Validation does not exist in EF Core (formerly EF7), so no need to change that one.

context.ChangeTracker.AutoDetectChangesEnabled is the one you are after, though we do this a lot less often in EF Core... so you shouldn't need to switch it off in most cases.

@rowanmiller Thank you for the information.

The case is that I don't want tracking to be on at all because tracking assumes that I have to fetch a whole entity from DB in order to change one or several properties and save it then. What I really want is just one operation, just one 'Update' method like it was realized in EF 6 EntityFramework.Extended.dll in BatchExtensions class. Why is it not still implemented in official EF?

Was this page helpful?
0 / 5 - 0 ratings