Entity Framework Core Plus Batch Delete - Batch Size
Problem
You need to delete millions of records and need to use a batch size to increase performance.
Solution
The BatchSize property sets the amount of rows to delete in a single batch.
Default Value = 4000
// using Z.EntityFramework.Plus; // Don't forget to include this. var date = DateTime.Now.AddYears(-2); ctx.Users.Where(x => x.LastLoginDate < date) .Delete(x => x.BatchSize = 1000);