public ActionResult Edit(Item item, int CategoryId) { if (CategoryId != 0) { _db.CategoryItem.Add(new CategoryItem() { CategoryId = CategoryId, ItemId = item.ItemId }); } _db.Entry(item).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Category category) { _db.Entry(category).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit(Class2 item) { _db.Entry(item).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index")); }