I am trying to bulk update records using Entity Framework. I have tried Entity Framework.Extensions Update method.
The Update method is abl
Use ExecuteSqlCommand:
using (yourDbEntities db = new yourDbEntities())
{
db.Database.ExecuteSqlCommand("UPDATE YourTABLE SET Quantity = {0} WHERE Id = {1}", quantity, id);
}
Or ExecuteStoreCommand:
yourDbContext.ExecuteStoreCommand("UPDATE YourTABLE SET Quantity = {0} WHERE Id = {1}", quantity, id);