Is it possible to perform simple SQL UPDATE operator with EF Core and LINQ? I want to use LINQ because of type and refactoring safety. And I need to avoid loading bulk of objects back and forth between an app and databse driver Basically I need smth like this:
DB.Items.Update(i => i.Value = 5).Where(i => i.Flag > 5);
You can use lightweight EFBulk nuget package.
Example code:
var count = db.Items.Where(s => s.Title == "Game")
.Update(o => new Item { Price = 999, Title = "Tablet" }, db);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With