public async Task <IActionResult> Edit(int id, [Bind("Id, Maker, Model, Name, Operational")] Plane plane) { if (id != plane.Id) { return(NotFound()); } if (ModelState.IsValid) { try { await _planeRepository.UpdateAsync(plane); } catch (DbUpdateConcurrencyException) { if (!await _planeRepository.ExistAsync(plane.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(plane)); }