public ActionResult Edit(Category category) { _db.Categories.Attach(category); _db.Entry(category).State = EntityState.Modified; _db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Create(Category category) { _db.Categories.Add(category); _db.SaveChanges(); return RedirectToAction("Index"); }