public async Task <ActionResult <UserWithStatsModel> > GetUsersWithStats(string id) { var userFromRepo = await _repository.GetUserByIdAsync(id); if (userFromRepo == null) { return(NotFound()); } var userWithStats = _mapper.Map <UserWithStatsModel>(userFromRepo); userWithStats.UserStats.UserFlightsCount = _statsRepository.GetFlightsCountForUser(id); userWithStats.UserStats.FlightsDistance = _statsRepository.GetFlightsDistanceForUser(id); userWithStats.UserStats.FlightsTime = _statsRepository.GetFlightsTimeForUser(id); userWithStats.UserStats.FlightsTime = _statsRepository.GetFlightsTimeForUser(id); userWithStats.UserStats.AirportsCount = _statsRepository.GetAirportsCountForUser(id); userWithStats.UserStats.AirportsCountryCount = _statsRepository.GetAirportsCountryCountForUser(id); return(Ok(userWithStats)); }