public async Task <IActionResult> GetCurrentWeatherData([FromQuery] GeoCoordinateCriteriaBase criteria)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var data = await _weatherService.GetCurrentWeather(criteria);

            return(Ok(data));
        }
Example #2
0
 public async Task <string> GetCurrentWeather(GeoCoordinateCriteriaBase criteria)
 => await _httpClient.GetStringAsync($"/data/2.5/weather?" +
                                     $"lat={criteria.Latitude}" +
                                     $"&lon={criteria.Longitude}" +
                                     $"&appid={GetAPIKey()}");