Ejemplo n.º 1
0
 public IActionResult Edit(Book book)
 {
     if (ModelState.IsValid)
     {
         _booksRepository.EditBook(book);
         return(RedirectToAction("Details", new { id = book.Id }));
     }
     else
     {
         ViewBag.Genres = GetGenres();
         return(View(book));
     }
 }
        public IActionResult EditBook([FromBody] Book book)
        {
            booksRepository.EditBook(book);

            return(Ok(1));
        }
Ejemplo n.º 3
0
        public IActionResult BookEdit(BookViewModel model, IFormFile uploadedImage, IFormFile uploadedFile)
        {
            _booksRepository.EditBook(model.Book, uploadedImage, uploadedFile);

            return(RedirectToAction("Books"));
        }
Ejemplo n.º 4
0
        public async Task <bool> EditBook(Book book)
        {
            var resBook = _mapper.Map <DataModels.Book>(book);

            return(await _booksRepo.EditBook(resBook));
        }