Batch Operations method allow to perform
DELETE operation directly in the database using a LINQ Query without loading entities in the context.
Everything is executed on the database side to let you get the best performance available.
Batch Operations Available:
Batch Operations Examples
Updating or deleting data with SaveChanges require to load data first which significantly reduce application performance.
It also becomes kind of weird to have to load an entity to after deleting it.
Batch Operations are executed directly on the database side which provides the best performance available.
|Operations||1,000 Entities||2,000 Entities||5,000 Entities|
|SaveChanges||1,000 ms||2,000 ms||5,000 ms|
|DeleteFromQuery||1 ms||1 ms||1 ms|
|UpdateFromQuery||1 ms||1 ms||1 ms|