Entity Framework Batch Delete Library

Introduction

Entity Framework Batch Delete library allow you to improve EF performance by deleting multiple records in a database from a LINQ Query without loading entities.

Why using Batch Delete with Entity Framework?

For HUGE performance gains.

Everything is executed on the database side.


Google – Related Searches


Stack Overflow – Related Questions

  • TBD


Example

// using Z.EntityFramework.Plus; // Don't forget to include this.
// DELETE all users inactive for 2 years
ctx.Users.Where(x => x.LastLoginDate < DateTime.Now.AddYears(-2))
.Delete();
// DELETE using a BatchSize
ctx.Users.Where(x => x.LastLoginDate < DateTime.Now.AddYears(-2))
.Delete(x => x.BatchSize = 1000);

Supported Library

Library Type EF Version Support Doc Features
Z.EntityFramework.Plus FREE EF5
EF6
EF Core
< 1 Day Yes
  • Audit
  • Batch Delete
  • Batch Update
  • Cache
  • Deferred Query
  • Filter
  • Future
  • Include Filter
  • Include Optimized

Unsuported Library

Use them at your risk!

Library Type EF Version Support Doc Features
EFUtilities FREE EF5
EF6
No No
  • Bulk Insert
  • Batch Delete
  • Batch Update
  • Include Optimized
EntityFramework.Extended FREE EF5
EF6
No Yes
  • Audit
  • Batch Delete
  • Batch Update
  • Cache
  • Future