public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Author,Isbn")] Book book) { if (id != book.Id) { return(NotFound()); } if (ModelState.IsValid) { try { await _booksService.Update(book); } catch (DbUpdateConcurrencyException) { if (!_booksService.BookExists(book.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(book)); }