public ActionResult Detail(string parkCode)
        {
            DetailViewModel p = new DetailViewModel()
            {
                Park = parkDAL.GetPark(parkCode),
                FiveDaysOfWeather = weatherDAL.GetForecast(parkCode),
                IsFahrenheit      = true
            };

            return(View("Detail", p));
        }
Beispiel #2
0
        public IActionResult Detail(string id)
        {
            DetailView detailView = new DetailView();
            var        park       = dal.GetPark(id);
            var        degree     = GetCurrentDegree();

            detailView.Park = park;
            var currentWeather = weatherDal.GetForecast(id);

            if (degree == "C")
            {
                foreach (var weather in currentWeather)
                {
                    weather.Degree = "C";
                    weather.High   = weather.ConvertToCelsius(weather.High);
                    weather.Low    = weather.ConvertToCelsius(weather.Low);
                }
            }
            detailView.fiveDay = currentWeather;
            return(View(detailView));
        }