コード例 #1
0
        public IActionResult Delete(int id)
        {
            _bookBusiness.Delete(id);
            return(NoContent());

            //return Ok();
        }
コード例 #2
0
 public ActionResult Delete(int id)
 {
     if (_booksBusiness.Delete(id))
     {
         return(NoContent());
     }
     return(NotFound());
 }
コード例 #3
0
        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"));
        }
コード例 #4
0
 public IActionResult Delete(long id)
 {
     if (_bookBusiness.Delete(id))
     {
         return(NoContent());
     }
     else
     {
         return(BadRequest());
     }
 }
コード例 #5
0
        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));
        }
コード例 #6
0
        public IActionResult Delete(long id)
        {
            var book = _bookBusiness.FindById(id);

            if (book == null)
            {
                return(NotFound());
            }
            _bookBusiness.Delete(id);

            return(NoContent());
        }
コード例 #7
0
 public IActionResult Delete(int id)
 {
     try
     {
         _bookBusiness.Delete(id);
         return(NoContent());
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
コード例 #8
0
        public IActionResult Delete(int id)
        {
            var result = _bookBusiness.FindById(id);

            if (result == null)
            {
                return(BadRequest());
            }

            _bookBusiness.Delete(id);

            return(NoContent());
        }
コード例 #9
0
        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());
        }
コード例 #10
0
 public IActionResult Delete(long id)
 {
     _bookBusiness.Delete(id);
     return(NoContent());
 }
コード例 #11
0
 public async Task  Delete(int id)
 {
     await business.Delete(id);
 }
コード例 #12
0
 //    [Authorize(Roles = "stockist, manager")]
 public IActionResult Delete(long id)
 {
     _bookBusiness.Delete(id);
     return(Ok("Book delete with sucess!"));
 }
コード例 #13
0
 public IActionResult Delete(int id)
 {
     _bookBusiness.Delete(id);
     return(NotFound());
 }
コード例 #14
0
 public void Delete(int id) => bookBusiness.Delete(id);
コード例 #15
0
 [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());
 }
コード例 #16
0
 public void Delete(int id)
 {
     _bus.Delete(id);
 }
コード例 #17
0
 public IActionResult Delete(int id, [FromServices] IBookBusiness bookBusiness)
 {
     bookBusiness.Delete(id);
     return(Ok());
 }