I want to update all the records of a particular column in MVC5 using linq query
var PriceRecord = db.tblPurchasePrices.Where(z => z.ID == id).SingleOrDefault();
var PurchasePriceList = db.tblPurchasePrices.Where(z => z.SizeID == PriceRecord.SizeID && z.ProductID == PriceRecord.ProductID && z.CategoryID == PriceRecord.CategoryID).ToList();
foreach (var item in PurchasePriceList)
{
item.IsActive = false;
db.SaveChanges();
}
i do not want to use foreach loop to update record one by one and save changes. i want all values in a particular column to update in one go.