示例#1
0
        public ActionResult Delete(int comicBookId, int id)
        {
            var comicBook       = comicBooksRepository.GetComicBookWithArtists(comicBookId);
            var comicBookArtist = comicBook.Artists.Where(cba => cba.Id == id).SingleOrDefault();

            comicBook.Artists.Remove(comicBookArtist);

            comicBooksRepository.DeleteArtistFromComicBook(comicBook, comicBookArtist);

            TempData["Message"] = "Your artist was successfully deleted!";

            return(RedirectToAction("Detail", "ComicBooks", new { id = comicBookId }));
        }