public IActionResult Delete(int id) { _bookBusiness.Delete(id); return(NoContent()); //return Ok(); }
public ActionResult Delete(int id) { if (_booksBusiness.Delete(id)) { return(NoContent()); } return(NotFound()); }
public ActionResult Delete(int id) { Book book = _bookBusiness.GetById(id); System.IO.File.Delete(Server.MapPath("/Content/Image/Book/" + book.ImageName)); System.IO.File.Delete(Server.MapPath("/Content/Image/Book/Thumbnail/" + book.ImageName)); _bookBusiness.Delete(id); _bookBusiness.Save(); return(RedirectToAction("Index")); }
public IActionResult Delete(long id) { if (_bookBusiness.Delete(id)) { return(NoContent()); } else { return(BadRequest()); } }
public JsonResult Delete(int id) { var book = bookBusiness.GetAll().ToList().Find(n => n.BookID == id); if (book != null) { bookBusiness.Delete(book); } return(Json(book, JsonRequestBehavior.AllowGet)); }
public IActionResult Delete(long id) { var book = _bookBusiness.FindById(id); if (book == null) { return(NotFound()); } _bookBusiness.Delete(id); return(NoContent()); }
public IActionResult Delete(int id) { try { _bookBusiness.Delete(id); return(NoContent()); } catch (Exception) { return(BadRequest()); } }
public IActionResult Delete(int id) { var result = _bookBusiness.FindById(id); if (result == null) { return(BadRequest()); } _bookBusiness.Delete(id); return(NoContent()); }
public IActionResult Delete(long id) { if (id <= 0) { return(BadRequest("Invalid book id")); } var bookOld = _business.FindById(id); if (bookOld.Id == null) { return(NotFound($"Book with id {id} not found")); } _business.Delete(id); return(NoContent()); }
public IActionResult Delete(long id) { _bookBusiness.Delete(id); return(NoContent()); }
public async Task Delete(int id) { await business.Delete(id); }
// [Authorize(Roles = "stockist, manager")] public IActionResult Delete(long id) { _bookBusiness.Delete(id); return(Ok("Book delete with sucess!")); }
public IActionResult Delete(int id) { _bookBusiness.Delete(id); return(NotFound()); }
public void Delete(int id) => bookBusiness.Delete(id);
[HttpDelete("{id}")] // Poderia ser usado um create public IActionResult Delete(long id) // Esse trecho faz um cast do body recebido para um objeto pessoa { _bookBusiness.Delete(id); return(NoContent()); }
public void Delete(int id) { _bus.Delete(id); }
public IActionResult Delete(int id, [FromServices] IBookBusiness bookBusiness) { bookBusiness.Delete(id); return(Ok()); }