public IActionResult Put([FromBody] BookVO book) { if (book == null) { return(BadRequest()); } var retorno = _bookBusiness.Update(book); if (retorno == null) { return(BadRequest()); } return(new ObjectResult(_bookBusiness.Update(book))); }
public IActionResult Put([FromBody] BookVO book) { if (book == null) { return(BadRequest()); } var updateBook = _bookBusiness.Update(book); if (updateBook == null) { return(NoContent()); } return(new ObjectResult(updateBook)); }
public IActionResult Put(int id, [FromBody] Book book) { if (book == null) { return BadRequest(); } var updatedPerson = _bookBusiness.Update(book); if (updatedPerson == null) { return NoContent(); } return new ObjectResult(_bookBusiness.Update(book)); }
[TypeFilter(typeof(HyperMediaFilter))] // AnotaĂ§Ă£o para o HATEOAS public IActionResult Put([FromBody] BookVO book) { if (book == null) { return(BadRequest()); } return(Ok(_bookBusiness.Update(book))); }
public ActionResult Put(int id, [FromBody] BookVO book) { if (book == null) { return(BadRequest()); } return(new ObjectResult(_booksBusiness.Update(book))); }
public JsonResult Update(Book book) { if (ModelState.IsValid) { bookBusiness.Update(book); } return(Json(book, JsonRequestBehavior.AllowGet)); }
public BookResponseViewModel Update(Guid key, BookRequestViewModel book) { var bookConsult = _bookBusiness.GetByKey(key); var bookEntity = _mapper.Map <Book>(book); bookEntity.UniqueKey = key; bookEntity.Id = bookConsult.Id; return(_mapper.Map <BookResponseViewModel>(_bookBusiness.Update(bookEntity))); }
public ActionResult Put([FromBody] BookVO book) { var bookUpdate = new ObjectResult(_bookBusiness.Update(book)); if (bookUpdate == null) { return(BadRequest()); } return(bookUpdate); }
// PUT api/values/5 public IActionResult Put([FromBody] BookVO book) { if (book == null) { return(BadRequest()); } book = _bookBusiness.Update(book); if (book.IsNull()) { return(NotFound()); } return(new ObjectResult(book)); }
public ActionResult Put(long id, [FromBody] BookInVO book) { try { var _entity = book.CreateEntity(); _entity.Id = id; _bookBusiness.Update(ref _entity); var _result = _entity.CreateVO <Book, BookOutVO>(); return(Ok(_result)); } catch (Exception ex) { return(this.ReturnActionResult(ex)); } }
public IActionResult Put([FromBody] BookVO book) { if (book == null) { return(BadRequest("Check book information")); } var updatedBook = _bookBusiness.Update(book); if (updatedBook == null) { return(BadRequest("It was not possible to update the data in this book.")); } return(new ObjectResult(updatedBook)); }
public IActionResult Put([FromBody] BookVO book) { if (book == null) { return(BadRequest("Invalid book")); } var bookOld = _business.FindById(book.Id.Value); if (bookOld.Id == null) { return(NotFound($"Book with id {book.Id} not found")); } return(new ObjectResult(_business.Update(book))); }
public IActionResult Put([FromBody] Book book) { if (book == null) { return(BadRequest()); } var updatedBook = _bookBusiness.Update(book); if (updatedBook == null) { return(BadRequest()); } return(Ok(updatedBook)); }
public IActionResult Put(long id, [FromBody] BookValue value, [FromServices] IBookBusiness bookBusiness, [FromServices] IMapper mapper) { value.Id = id; var bookDomain = mapper.Map <Book>(value); var bookUpdated = bookBusiness.Update(bookDomain); if (bookUpdated != null) { return(Ok(mapper.Map <BookValue>(bookUpdated))); } else { return(NotFound()); } }
public IActionResult Put([FromBody] BookVO books) { if (books == null) { return(BadRequest()); } var result = _bookBusiness.Update(books); if (result == null) { return(BadRequest()); } return(Ok()); }
public IActionResult Put([FromBody] Book book) { if (book == null) { return(BadRequest()); } var updatedPerson = _bookBusiness.Update(book); if (updatedPerson == null) { return(BadRequest()); } return(new ObjectResult(updatedPerson)); //return Ok(); }
public IActionResult Put(Book book) { try { if (book != null) { return(Ok(_bookBusiness.Update(book))); } else { return(NotFound()); } } catch (Exception) { return(BadRequest()); } }
public ActionResult Edit([Bind(Include = "BookId,Title,Description,Text,Visit,CreateDate,ImageName")] Book book , HttpPostedFileBase imageBook) { if (ModelState.IsValid) { if (imageBook != null && imageBook.IsImage()) { System.IO.File.Delete(Server.MapPath("/Content/Image/Book/" + book.ImageName)); System.IO.File.Delete(Server.MapPath("/Content/Image/Book/Thumbnail/" + book.ImageName)); book.ImageName = Guid.NewGuid().ToString() + Path.GetExtension(imageBook.FileName); imageBook.SaveAs(Server.MapPath("/Content/Image/Book/" + book.ImageName)); ImageResizer img = new ImageResizer(); img.Resize(Server.MapPath("/Content/Image/Book/" + book.ImageName), Server.MapPath("/Content/Image/Book/Thumbnail/" + book.ImageName)); } _bookBusiness.Update(book); _bookBusiness.Save(); return(RedirectToAction("Index")); } return(View(book)); }
public IActionResult Update([FromBody] Book book) { return(Ok(_business.Update(book))); }
public void Put(int id, [FromBody] Book value) { _bus.Update(value); }
public void Update([FromBody] Book value) { _bus.Update(value); }
public IActionResult Put([FromBody] BookVO book) { return(Ok(_bookBusiness.Update(book))); }
public void Update([FromBody] BookUpdate bookUpdate) => bookBusiness.Update(bookUpdate);
public IActionResult Update([FromBody] Book item) { if (item == null) return BadRequest(); return Ok(_bookBusiness.Update(item)); }
/// <summary> /// Alterar um livro chamando a camada de business /// </summary> /// <param name="book">Livro que serĂ¡ alterado</param> /// <returns>Livro alterado</returns> public BookModel Update(BookModel book) { return(_bookBusiness.Update(book)); }
public async Task Update([FromBody] Book newBook) { await business.Update(newBook); }