public async Task <IList <RateItem> > GetRatesList() { try { var result = await _httpService.GetAsync(url); return(_jsonParser.Parse <List <RateItem> >(result)); } catch (Exception ex) { throw new Exception("GetRatesList exception", ex); } }
public async Task <Weather> GetWeatherForCityAsync(string city) { WebUtility.UrlEncode(city); var weatherJson = await _httpService.GetAsync(string.Format(url, city, weatherApiKey)); var weatherResponce = _jsonParser.Parse <WeatherResponce>(weatherJson); var details = weatherResponce.Weather.First(); return(new Weather { Name = weatherResponce.Name, Description = details.Description, Temperature = weatherResponce.Main.Temp }); }