Exemplo n.º 1
0
        protected virtual async Task <BasicWeatherInfo> GetWeatherInfoAsyncInner(string city)
        {
            var request = new BaseWeatherInfoServiceRequest
            {
                Url    = _baseUrl + _apiKey + @"/50.45466,30.5238",
                Method = HttpMethod.Get
            };

            var response = await _client.SendAsync <BaseWeatherInfoServiceRequest, DarkSkyDataModel>(request);

            var result = _utils.MapToBasicModel(response);

            return(result);
        }
Exemplo n.º 2
0
        protected virtual async Task <BasicWeatherInfo> GetWeatherInfoAsyncInner(string city)
        {
            string url = $"{_baseUrl}?q={city}&appid={_apiKey}";

            var request = new BaseWeatherInfoServiceRequest
            {
                Url    = url,
                Method = HttpMethod.Get
            };

            var response = await _client.SendAsync <BaseWeatherInfoServiceRequest, OpenWeatherMapDataModel>(request);

            var result = _utils.MapToBasicModel(response);

            return(result);
        }