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