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