public ActionResult Delete(int id, Author author)
 {
     try
     {
         authorRepository.Delete(id);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
示例#2
0
        public ActionResult ConfirmDelete(int id)
        {
            try

            {
                bookRepository.Delete(id);
                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }