The library Entity.Framework.Extensions (paid) has a method for doing entity updates:
context.Customers
.Where(c=>c.XXX = "")
.UpdateFromQuery(c=>new Customer{ Timestamp = DateTime.UtcNow })
The library Entity.Framework.Plus (free) has a similar method for doing entity updates:
context.Customers
.Where(c=>c.XXX = "")
.Update(c=> new Customer{ Timestamp = DateTime.UtcNow })
What is the difference between these two implementations?
There is a slight difference between both libraries for SQL Server due to how they have been implemented. However, they should support all the same scenarios.
For other providers, the same base code is used.
At one point in the future, we plan to only keep this feature Batch Delete
and Batch Update
in only one of our libraries.
If we choose to keep it under Entity Framework Extensions, we will make sure this feature will be available for free
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