Exemple #1
0
        public async Task <IActionResult> Register(CreateUserModel createUserModel)
        {
            _logger.LogInformation("Started : Registering User.");
            CreateUserDto userDto = _mapper.Map <CreateUserDto>(createUserModel);
            bool          _registrationSuccess = await _userService.RegisterUser(userDto);

            if (_registrationSuccess)
            {
                return(Ok(
                           new ApiResponse <string>
                {
                    IsSuccess = true,
                    Result = "Success.",
                    Message = "Registration successful."
                }));
            }
            else
            {
                return(BadRequest(
                           new ApiResponse <string>
                {
                    IsSuccess = false,
                    Result = "Fail.",
                    Message = "Some error occurred. Please refresh page and try again."
                }));
            }
        }
Exemple #2
0
        public async Task <bool> Register([FromBody] RegisterModel model)
        {
            var result = await _userContract.RegisterUser(_mapper.Map <RegisterModel, RegisterPOCO>(model));

            if (result)
            {
                return(true);
            }
            return(false);
        }
Exemple #3
0
        public async Task RegisterUser()
        {
            bool result = await _userService.RegisterUser(userDto);

            Assert.AreEqual(true, result);
        }