public IHttpActionResult DeleteBook(int id) { if (id <= 0) { return(BadRequest("Not a valid Book id")); } books.Delete(id); return(Ok()); }
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")); }
public ActionResult DeleteBook(int bookId) { _bookLogic.Delete(bookId); return(RedirectToAction("AllBooks")); }