private async Task <TrafficJamsResponse> GetDataForSingleRegionAsync(HttpClient httpClient, string uri)
        {
            TrafficJamsResponse trafficJamsResponse = new TrafficJamsResponse();

            try
            {
                HttpResponseMessage response = await httpClient.GetAsync(uri);

                trafficJamsResponse = new TrafficJamsResponse {
                    HttpStatusCode = response.StatusCode
                };
                if (response.IsSuccessStatusCode)
                {
                    string responseString = await response.Content.ReadAsStringAsync();

                    Info regionInfo = DeserializeXml(responseString);
                    if (regionInfo != null)
                    {
                        trafficJamsResponse.ResponseStatus = true;
                    }
                    trafficJamsResponse.Data = regionInfo;
                }
            }
            catch (Exception exception)
            {
                trafficJamsResponse.ResponseStatus = false;
                trafficJamsResponse.Exception      = exception;
            }

            return(trafficJamsResponse);
        }
        public async Task <TrafficJamsResponse> GetRegionTrafficJamsAsync(int code)
        {
            TrafficJamsResponse       response = new TrafficJamsResponse();
            IDictionary <int, string> regions  = await _provider.GetAvailableRegionsAsync();

            if (regions.Keys.Contains(code))
            {
                response = await _cache.GetOrAddAsync(code, async regionCode =>
                {
                    var httpClient = _clientFactory.CreateClient();
                    return(await GetDataForSingleRegionAsync(httpClient,
                                                             string.Format(_yandexApiTemplate, regionCode, 1000)));
                });
            }

            return(response);
        }