I am trying to find ways to do multiple record update using foreach loop similar to snippet below. This snippet doesn't work on value type. If anyone would like to share their experience of multiple record update in MVC Framework. Thanks in advance
public ActionResult UpdateProductPrice()
{
var products = _rep.GetProducts();
foreach (Product p in products)
{
decimal oPrice = p.Price;
p.Price = oPrice * .15
UpdateModel(p);
_rep.Save();
}
return View("Index");
}