public async Task <IActionResult> Edit(int id, [Bind("ID,QuoteText,AuthorID")] Quote quote) { if (id != quote.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(quote); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!QuoteExists(quote.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["AuthorID"] = new SelectList(_context.Authors, "AuthorID", "Name", quote.AuthorID); return(View(quote)); }