public async Task <WeatherForecastResult> WeatherForecasts([FromQuery] WeatherQuery weatherQuery)
        {
            if (cache.TryGetForecasts(weatherQuery.City, out var cachedForecasts))
            {
                return(WeatherForecastResult.Successfull(cachedForecasts));
            }

            var weatherForecastResult = await weatherSource.GetWeatherFor(weatherQuery.City, weatherQuery.DaysCount);

            if (weatherForecastResult.Status == Status.Success)
            {
                cache.UpdateCache(weatherQuery.City, weatherForecastResult.WeatherForecast);
            }

            return(weatherForecastResult);
        }
        public async Task <WeatherForecastResult> GetWeatherFor(string city, int daysCount)
        {
            var urlParameters = $"?q={city}&appid={apiKey}";

            var(statusCode, jsonResponse) = await restClient.GetData(URL, urlParameters);

            if (statusCode == HttpStatusCode.OK)
            {
                var weatherForecast = parser.Parse(jsonResponse)
                                      .GroupBy(x => x.Date)
                                      .Select(x => x.First())
                                      .Take(daysCount)
                                      .ToArray();

                return(WeatherForecastResult.Successfull(weatherForecast));
            }

            return(statusCode == HttpStatusCode.NotFound
                ? WeatherForecastResult.NotFound
                : WeatherForecastResult.UnknownError);
        }