Example #1
0
        public IActionResult Add(UserAuth userAuth)
        {
            var result = _userAuthService.Add(userAuth);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Example #2
0
        public IDataResult <UserAuth> Register(UserForRegisterDto userForRegisterDto, string password)
        {
            byte[] passwordHash, passwordSalt;
            HashingHelper.CreatePasswordHash(password, out passwordHash, out passwordSalt);
            var userAuth = new UserAuth
            {
                Email        = userForRegisterDto.Email,
                FirstName    = userForRegisterDto.FirstName,
                LastName     = userForRegisterDto.LastName,
                PasswordHash = passwordHash,
                PasswordSalt = passwordSalt,
                Status       = true
            };

            _userAuthService.Add(userAuth);
            return(new SuccessDataResult <UserAuth>(userAuth, Messages.UserRegistered));
        }
Example #3
0
 public Task <IResultModel> Add(UserAuthAddModel model)
 {
     return(_service.Add(model));
 }