Пример #1
0
 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));
 }
Пример #2
0
        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);
        }