There's more...

There's a library named EntityFramework.Extended that is used to create batches in the older versions of EF. We can also use it in ASP.NET Core with Framework .NET 4.6.

The syntax would be the following:

//update all book with id of 1 to id of 2context.Books.Where(b => b.Id == 1) .Update(t => new Book { Id = 2 });//delete all books where Name matchescontext.Books.Where(u => u.Name == "SQL").Delete();

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.