Exemple #1
0
        public IActionResult Delete(PublisherDeleteViewModel viewModel)
        {
            Publisher publisher = publisherService.GetByID(viewModel.Publisher.ID);

            if (publisher == null)
            {
                return(NotFound());
            }

            publisherService.Delete(publisher.ID);
            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public IActionResult Delete(int id)
        {
            if (id == 0)
            {
                return(NotFound());
            }

            Publisher publisher = publisherService.GetByID(id);

            if (publisher == null)
            {
                return(NotFound());
            }

            PublisherDeleteViewModel viewModel = new PublisherDeleteViewModel
            {
                Publisher = publisher
            };

            return(View(viewModel));
        }