Beispiel #1
0
        public async Task UpdateUserAsync(int id, UserNamePasswordEmailAdminDTO userDto)
        {
            var user = await _unitOfWork.UserRepository.GetByIdAsync(id);

            user.Username = userDto.Username;
            user.Email    = userDto.Email;
            user.IsAdmin  = userDto.IsAdmin;

            if (user.Password != userDto.Password)
            {
                user.Password = Utils.HashPassword(userDto.Password);
            }

            _unitOfWork.UserRepository.Update(user);
        }
Beispiel #2
0
        public async Task UpdateUserAsync(int id, UserNamePasswordEmailAdminDTO userDto)
        {
            await _userService.UpdateUserAsync(id, userDto);

            await _unitOfWork.CommitAsync();
        }