public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Department department) { if (id != department.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(department); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DepartmentExists(department.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(department)); }
public async Task <IActionResult> Edit(int id, [Bind("id,id_tabelionato,nome,login,senha,status,aniversario")] Usuarios usuarios) { if (id != usuarios.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuarios); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuariosExists(usuarios.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(usuarios)); }