public async Task <IActionResult> Edit(string id, [Bind("Code,Name,Description,Capacity")] Venue venue) { if (id != venue.Code) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(venue); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VenueExists(venue.Code)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(venue)); }