예제 #1
0
        public async Task <IActionResult> GetById([FromRoute] string userId)
        {
            var exists = await _context.AppUsers.AnyAsync(usr => usr.Id == userId);

            if (!exists)
            {
                return(NotFound());
            }
            var user = await _appUsersService.GetById(userId);

            // Transform it to a UserDto with Links
            var response = new GetUserResponse(user);

            return(Ok(response));
        }