public ActionResult DeleteGenre(Genre vm) { Repository.Delete(Repository.GetGenre(vm.Id)); Repository.Save(); return RedirectToAction("genres"); }
public ActionResult EditGenre(Genre vm) { if (!ModelState.IsValid) return View(vm); UpdateModel(Repository.GetGenre(vm.Id)); Repository.Save(); return RedirectToAction("genres"); }
public ActionResult CreateGenre() { var vm = new Genre { SequenceIdentifier = int.MaxValue }; return View(vm); }
public ActionResult CreateGenre(Genre vm) { if (!ModelState.IsValid) return View(vm); Repository.Add(vm); Repository.Save(); return RedirectToAction("genres"); }
partial void DeleteGenre(Genre instance);
partial void UpdateGenre(Genre instance);
partial void InsertGenre(Genre instance);
public void Delete(Genre genre) { _db.Genres.DeleteOnSubmit(genre); }
public void Add(Genre genre) { _db.Genres.InsertOnSubmit(genre); }