public ActionResult Edit(int id) { throw new Exception("dd"); AlbumRepository albumRepository = new AlbumRepository(); var albumToEdit = albumRepository.GetAllAlbums().FirstOrDefault(x => x.Id == id); if (albumToEdit != null) { return View(albumToEdit); } else { return HttpNotFound(); } }
public ActionResult Delete(int id) { AlbumRepository albumRepository = new AlbumRepository(); var albumToDelete = albumRepository.GetAllAlbums().FirstOrDefault(x => x.Id == id); if (albumToDelete != null) { albumRepository.DeleteAlbum(albumToDelete); return Redirect("/Admin/Album/List"); } else { return HttpNotFound(); } }
public ActionResult List() { AlbumRepository albumRepository = new AlbumRepository(); List<Nwd.BackOffice.Model.Album> listAlbums = albumRepository.GetAllAlbums(); return View(listAlbums); }