public async Task <IActionResult> Edit(int id, [Bind("ID,Titulo,FechaEstreno,Genero,Precio,Stock,Rating")] Videos videos) { if (id != videos.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(videos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VideosExists(videos.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(videos)); }
public async Task <IActionResult> Edit(int id, [Bind("idConsulta,nombre,fecha,hora")] Persona persona) { if (id != persona.idConsulta) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(persona); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonaExists(persona.idConsulta)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(persona)); }