public ActionResult Add(int comicBookId)
        {
            var comicBook = _comicBooksRepository.GetById(comicBookId);

            if (comicBook == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new ComicBookArtistsAddViewModel()
            {
                ComicBook = comicBook
            };

            viewModel.Init(Context);

            return(View(viewModel));
        }
        public ActionResult Detail(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var comicBook = _comicBooksRepository.GetById((int)id);

            if (comicBook == null)
            {
                return(HttpNotFound());
            }

            // Sort the artists.
            comicBook.Artists = comicBook.Artists.OrderBy(a => a.Role.Name).ToList();

            return(View(comicBook));
        }
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            //  Get the comic book.
            var comicBook = _comicBooksRepository.GetById((int)id);

            if (comicBook == null)
            {
                return(HttpNotFound());
            }

            var viewModel = new ComicBooksEditViewModel()
            {
                ComicBook = comicBook
            };

            viewModel.Init(Repository);

            return(View(viewModel));
        }