Mohamed Hendawy
Jan 21, 2024

--

It will reduce the round-trips as it's a single call to SaveChanges.

but :

1- you still have to loop on the productsToUpdate

2- In the case of UpdateRange, Entity Framework can generate a single SQL statement that updates multiple rows in a batch. This batch update operation can be more efficient in terms of processing time and resource utilization on both the application and database sides. It sends a bulk update operation to the database, which can be more performant than issuing individual update statements in a loop.

--

--

Responses (1)