public async Task <IActionResult> Edit(int id, [Bind("Id,NroInterno,Usuario,Celular")] InternosEntity internosEntity) { if (id != internosEntity.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(internosEntity); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InternosEntityExists(internosEntity.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(internosEntity)); }
public async Task <IActionResult> Create([Bind("Id,NroInterno,Usuario,Celular")] InternosEntity internosEntity) { if (ModelState.IsValid) { _context.Add(internosEntity); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(internosEntity)); }