public async Task Update(UpdateBookView updateBook) { await _bookrepository.Update(new Book() { Title = updateBook.Title, Price = updateBook.Price, Id = updateBook.Id }); }
public async Task Update(UpdateBookView model) { var book = await _bookRepository.GetById(model.Id); if (book == null) { throw new ArgumentNullException("Book received a null argument!"); } book.Name = model.Name; book.Price = model.Price; book.Author = model.Author; await _bookRepository.Update(book); }
public async Task <IActionResult> Update(UpdateBookView model) { await _bookService.Update(model); return(RedirectToAction("Index")); }
public async Task <IActionResult> Update(UpdateBookView updateBook) { await _bookService.Update(updateBook); return(Ok()); }