public async Task <ActionResult> CreateBook(BookUpsertDto createBookDto)
        {
            var book = new Book();

            _mapper.Map(createBookDto, book);

            _bookRepository.AddBook(book);

            if (await _bookRepository.SaveAllAsync())
            {
                return(Ok(createBookDto));
            }

            return(BadRequest("Failed to create a new Book"));
        }
        public async Task <ActionResult> UpdateBook(int id, BookUpsertDto updateBookDto)
        {
            var book = await _bookRepository.GetBookByIdAsync(id);

            if (book == null)
            {
                return(NotFound());
            }

            _mapper.Map(updateBookDto, book);

            _bookRepository.UpdateBook(book);

            if (await _bookRepository.SaveAllAsync())
            {
                return(NoContent());
            }

            return(BadRequest("Failed to update book"));
        }