public async Task <WeatherForecast> GetForecast(double latitude, double longitude, int days) { UriBuilder builder = new UriBuilder(_baseEndpoint) { Path = $"weather/forecast/by-lat-lng", Query = $"lat={latitude.ToString(CultureInfo.InvariantCulture)}&lng={longitude.ToString(CultureInfo.InvariantCulture)}&filter=daily" }; var header = new Dictionary <string, string> { { "x-api-key", _serviceKey } }; AmbeeForecastDTO weatherResponse = await _requestService.GetAsync <AmbeeForecastDTO>(builder.Uri, header); AmbeeMapper ambeeMapper = new AmbeeMapper(); WeatherForecast weatherForecast = ambeeMapper.ToDomainEntities(weatherResponse, _runtimeContext.CityName, _isImperial); weatherForecast.WeatherList = weatherForecast.WeatherList.GetRange(0, days); return(weatherForecast); }