public void UpdateBook(int bookId, UpdateBookData data)
        {
            var book = _booksRepository.GetBook(bookId);

            if (book == null)
            {
                throw new ArgumentException($"Cannot edit book {bookId} cause it is not exist!");
            }

            UpdateBookData(book, data);
            _booksRepository.UpdateBook(book);
        }
        private void UpdateBookData(Book book, UpdateBookData data)
        {
            UpdateValue((value) => book.Title      = value, data.Title);
            UpdateValue((value) => book.ISBN       = value, data.ISBN);
            UpdateValue((value) => book.PageNumber = (int)value, data.PageNumber);
            UpdateValue((value) => book.Publisher  = value, data.Publisher);
            UpdateValue(() => book.PublicationDate = new DateTime(data.PublishYear.Value, 1, 1),
                        data.PublishYear);

            if (data.AuthorIds != null)
            {
                var authors = _authorsRepository.GetAuthors(data.AuthorIds);
                book.SetAuthors(authors);
            }
        }