Example #1
0
        public async Task <IActionResult> GetPassengersForUser()
        {
            if (!int.TryParse(User.FindFirst(ClaimTypes.NameIdentifier)?.Value ?? string.Empty, out var userId))
            {
                return(Unauthorized());
            }

            var result = await _passengerRepository.GetPassengersForUser(userId);

            return(result != null?Ok(result) : StatusCode((int)HttpStatusCode.InternalServerError));
        }