public IActionResult GetById(string id)
 {
     try
     {
         UserViewModel user = MapToUserToUserVM(_usersReadService.GetUserById(id).Result.User);
         return(Ok(user));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Esempio n. 2
0
        public async Task <TravelUser> FindByIdAsync(string userId, CancellationToken cancellationToken)
        {
            var result = await _usersReadService.GetUserById(userId);

            if (result.Status == ResponseStatus.Succeeded)
            {
                return(result.User);
            }
            return(null);
        }