Example #1
0
        public IActionResult EditBook(Book bookToEdit)
        {
            // Assert model state
            if (ModelState.IsValid)
            {
                // Edit and update a book in the database
                _bookRepository.EditBook(bookToEdit);

                // Redirect to action
                return(RedirectToAction("BooksList"));
            }
            else
            {
                return(View(bookToEdit));
            }
        }
Example #2
0
 public void EditBook(Books book)
 {
     ibook.EditBook(book);
 }