Example #1
0
        public IActionResult Update(BookUpdateViewModel model)
        {
            var bookEntity = _mapper.Map <Book>(model);

            _bookService.RemoveRelationForAuthor(model.BookId);
            _bookService.Update(bookEntity);
            _bookService.AddRelationForAuthor(bookEntity.BookAuthors);
            return(RedirectToAction("Index", "Book"));
        }