コード例 #1
0
        public User InsertNewUser(User user)
        {
            if (IsDuplicateUser(user))
            {
                return(null);
            }

            user.Password = HashingSHA.GenerateSHA256String(user.Password);
            return(_userRepository.AddUser(user));
        }
コード例 #2
0
        public async Task <User> InsertNewUser(User user)
        {
            if (await _userRepository.IsDuplicateUser(user))
            {
                return(null);
            }

            user.Password = HashingSHA.GenerateSHA256String(user.Password);
            return(await _userRepository.AddUser(user));
        }
コード例 #3
0
        public async Task <UserDto> InsertNewUser(UserDto user)
        {
            var result = await _userRepository.AddUser(new User
            {
                FirstName = user.FirstName,
                LastName  = user.LastName,
                Email     = user.Email,
                Role      = await _roleRepository.GetRole(user.Type.ToString()),
                Password  = HashingSHA.GenerateSHA256String(user.Password)
            });

            return(result.ToUserDto());
        }
コード例 #4
0
 public async Task <Boolean> VerifyPassword(UserDto user, String password)
 {
     return(await _userRepository.CheckUserPassword(user.Email, HashingSHA.GenerateSHA256String(password)));
 }
コード例 #5
0
 public User GetValidUser(User user)
 {
     user.Password = HashingSHA.GenerateSHA256String(user.Password);
     return(_userRepository.GetValidUser(user));
 }
コード例 #6
0
 public async Task <User> GetValidUser(User user)
 {
     user.Password = HashingSHA.GenerateSHA256String(user.Password);
     return(await _userRepository.GetValidUser(user));
 }