public async Task <IActionResult> Edit(int id, [Bind("ID,UserName,Password,FirstName,LastName")] Patient patient) { if (id != patient.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(patient); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientExists(patient.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(patient)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,UserName,Password,Position")] Users users) { if (id != users.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(users); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(users.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(users)); }