public async Task <IActionResult> Edit(int id, [Bind("AirportID,Name,latitude,Longitude")] Airport airport) { if (!airport.AirportID.Equals(id)) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(airport); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AirportExists(airport.AirportID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(airport)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,OriginAirportId,DestinyAirportId")] Flight flight) { if (!id.Equals(flight.ID)) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(flight); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FlightExists(flight.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(flight)); }