public ActionResult Edit([Bind(Include = "ProductID,Quantity,ReorderLevel")] ProductHolding productHoldings) { if (ModelState.IsValid) { db.Entry(productHoldings).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(productHoldings)); }
public int Update(T entity) { var entry = _model.Entry(entity); _model.Set <T>().Attach(entity); entry.State = System.Data.Entity.EntityState.Modified; int result = _model.SaveChanges(); return(result); }