public IActionResult Delete(PublisherDeleteViewModel viewModel) { Publisher publisher = publisherService.GetByID(viewModel.Publisher.ID); if (publisher == null) { return(NotFound()); } publisherService.Delete(publisher.ID); return(RedirectToAction("Index")); }
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)); }