public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Email,Asunto,Telefono,Mensaje")] Contacto contacto) { if (id != contacto.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(contacto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactoExists(contacto.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(contacto)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Email")] Suscriptor suscriptor) { if (id != suscriptor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(suscriptor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SuscriptorExists(suscriptor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(suscriptor)); }