public IActionResult Edit(long id, [Bind("UserName,Email,Password,Id,AddedDate,ModifiedDate,IPAddress")] User user) { if (id != user.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _userRepository.Update(user); _userRepository.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public void UpdateUser(User user) { _userRepository.Update(user); }