Example #1
0
        public async Task <IActionResult> GetUserByUserName(string userName)
        {
            var user = await _userService.GetUserByUserName(userName);

            if (user != null)
            {
                return(Ok(UserToUserViewModelMapper.UserToUserViewModel(user)));
            }
            return(NotFound());
        }
Example #2
0
        public async Task <IActionResult> Post([FromBody] IServices.Requests.CreateUser createUser)
        {
            var user = await _userService.CreateUser(createUser);

            return(Created(user.UserId.ToString(), UserToUserViewModelMapper.UserToUserViewModel(user)));
        }