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);
Exemple #8
0
 public void Delete(Genre genre)
 {
     _db.Genres.DeleteOnSubmit(genre);
 }
Exemple #9
0
 public void Add(Genre genre)
 {
     _db.Genres.InsertOnSubmit(genre);
 }