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); }
public IActionResult CurrentWeatherAndForecast(CurrentWeatherAndForecast currentAndForecast) { return(View("CurrentAndForecast", currentAndForecast)); //send model and display data of forecast }