コード例 #1
0
        public IViewComponentResult Invoke(string city)
        {
            string query = "https://api.openweathermap.org/data/2.5/forecast?q=+" + city + "&units=metric&appid=" + _config.GetValue <string>("WeatherForcastAPIKey");
            WeatherForecastData weatherData = _forecastService.GetWeatherForecast(query).Result;

            return(View(weatherData));
        }