public async Task <IActionResult> GetAsync([FromRoute] int id) { var user = await _manager.UserRepository.GetAsync(id, false); if (user == null) { return(NotFound()); } return(Ok(UserMapper.CompleteMap(user))); }
public async Task <IActionResult> GetAsync() { var users = await _manager.UserRepository.GetAsync(false); if (users.ToList().Count == 0) { return(NotFound()); } return(Ok(users.Select(u => UserMapper.CompleteMap(u)))); }
public async Task <IActionResult> GetSignedInAsync() { var userId = HttpContext.User.GetUserId(); if (!userId.HasValue) { return(Unauthorized()); } var user = await _manager.UserRepository.GetAsync(userId.Value, false); if (user == null) { return(NotFound()); } return(Ok(UserMapper.CompleteMap(user))); }