Beispiel #1
0
 public IHttpActionResult DeleteBook(int id)
 {
     if (id <= 0)
     {
         return(BadRequest("Not a valid Book id"));
     }
     books.Delete(id);
     return(Ok());
 }
Beispiel #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            var model = mapper.Map <DeleteBookViewModel>(books.GetById(id));

            try
            {
                if (books.Delete(id))
                {
                    return(RedirectToAction("Index"));
                }
                return(View(model));
            }
            catch
            {
                return(View(model));
            }
        }
 public ActionResult DeleteBook(int id)
 {
     bookLogic.Delete(id);
     return(RedirectToAction("Index", "Book"));
 }
Beispiel #4
0
 public ActionResult DeleteBook(int bookId)
 {
     _bookLogic.Delete(bookId);
     return(RedirectToAction("AllBooks"));
 }