Strongly typed bulk operations

Entity Framework Core 1.0 supports two query options:

  • SQL
  • LINQ

LINQ, of course, is the preferred query language in the .NET world. It has the great advantage that it is compiled to .NET and is strongly typed, meaning most errors are detected at compile time. The drawback is that it cannot be used for anything other than querying, that is, it cannot do updates, inserts, or deletes.

However, because of the great extensibility hooks that are present in Entity Framework Core, it is indeed possible to turn strongly typed LINQ queries into updates and deletes. In particular, Pomelo Foundation has implemented a library for doing just that.

Getting ready

We will be using the NuGet Package Manager to install the Entity Framework ...

Get Entity Framework Core Cookbook - Second Edition 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.