public IActionResult EndEditEmployee(UsersViewModel UsersViewModel) { if (!ModelState.IsValid) { return(View("EditEmployee", UsersViewModel)); } if (UsersViewModel is null) { throw new ArgumentNullException(nameof(UsersViewModel)); } User employee = new User() { Id = UsersViewModel.Id, FirstName = UsersViewModel.FirstName, LastName = UsersViewModel.LastName, Email = UsersViewModel.Email, Age = UsersViewModel.Age, }; UsersDataService.Update(employee); return(RedirectToAction("Index")); }
public void UpdateUser(Users user) { _usersDataService.Update(user); }
public async Task <int> Update(UserDto userDto) { var entity = FactoryMapper.MapToEntity(userDto); return(await _userService.Update(entity)); }