コード例 #1
0
        public CurrentWeatherAndForecast GetCurrentAndForecast(Town town)
        {
            var current         = GetCurrentWeather(town); //get current weather
            var forecastWeather = GetForecast(town);       //get weather forecast

            CurrentWeatherAndForecast currentWeatherAndForecast = new CurrentWeatherAndForecast()
            {
                currentWeather = current, forecast = forecastWeather, town = town
            };

            return(currentWeatherAndForecast);
        }
コード例 #2
0
 public IActionResult CurrentWeatherAndForecast(CurrentWeatherAndForecast currentAndForecast)
 {
     return(View("CurrentAndForecast", currentAndForecast)); //send model and display data of forecast
 }