30% OFF - 10th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY10
Entity Framework Bulk Delete Discover who support this features
Introduction
BulkDelete allows you to improve EF performance by deleting multiple entities with bulk operations.
Why BulkDelete?
For HUGE performance gains, Entity Framework makes one database round-trip for each entity to delete.
So if you want to modify 10,000 entities, 10,000 database round trip will be required which is INSANELY slow. To use BulkDelete, you will need to use a third-party library.
Operations | 1,000 Entities | 2,000 Entities | 5,000 Entities |
---|---|---|---|
BulkDelete | 45 ms | 50 ms | 60 ms |
SaveChanges | 1,000 ms | 2,000 ms | 5,000 ms |
Google Related Searches
- Entity Framework Delete Multiple Records
- Entity Framework Delete Multiple Rows
- Entity Framework Remove Range
StackOverflow Related Questions
// using Z.EntityFramework.Extensions; // Don't forget to include this. // Easy to use context.BulkDelete(list); // Easy to customize context.BulkDelete(list, bulk => bulk.BatchSize = 100);
Supported Libraries
Library | Type | EF Version | Support | Doc | Features |
---|---|---|---|---|---|
Z.EntityFramework.Extensions | PRO | EF6 | < 1 Day | Yes | Bulk SaveChanges Bulk Insert Bulk Update Bulk Delete Bulk Merge |
ZZZ Projects