Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differense between EF Extensions UpdateFromQuery() and EF Plus Update()

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?

like image 962
Freddy Avatar asked Oct 30 '22 01:10

Freddy


1 Answers

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

like image 189
Jonathan Magnan Avatar answered Jan 02 '23 19:01

Jonathan Magnan