public ActionResult Create(Categories categories) { if (ModelState.IsValid) { db.Categories.Add(categories); db.SaveChanges(); return RedirectToAction("Index"); } return View(categories); }
public ActionResult Edit(Categories categories) { if (ModelState.IsValid) { db.Entry(categories).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(categories); }