public async Task <IActionResult> Edit(int id, [Bind("AvionId,Modelo,Tipo,Capacidad,Estado")] avion avion) { if (id != avion.AvionId) { return(NotFound()); } if (ModelState.IsValid) { try { Avio.Update(avion); await Avio.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!avionExists(avion.AvionId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(avion)); }
public async Task <IActionResult> Create([Bind("AvionId,Modelo,Tipo,Capacidad,Estado")] avion avion) { if (ModelState.IsValid) { Avio.Add(avion); await Avio.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(avion)); }