Beispiel #1
0
        public IActionResult AddBook(BookInputModel newBook)
        {
            if (ModelState.IsValid)
            {
                var book = new Book
                {
                    Title       = newBook.Title,
                    Author      = newBook.Author,
                    Description = newBook.Description,
                    Genre       = newBook.Genre,
                    Price       = newBook.Price,
                    ImageLink   = newBook.ImageLink
                };

                _accountService.AddNewBook(book);
                return(View("BookAdded"));
            }
            return(View());
        }