コード例 #1
0
        public async Task <ActionResult> Detail(string cityName)
        {
            if (ControllerContext.HttpContext.Session["history"] == null)
            {
                ControllerContext.HttpContext.Session["history"] = Guid.NewGuid().ToString("N");
            }
            var rt = await _weather.GetInfoAsync(cityName);

            if (!_weather.IsError)
            {
                LogChangeHelp lh = new LogChangeHelp();
                lh.ChangeDB(cityName, rt, (string)Session["history"], _uw.LogRepository);
            }
            ViewBag.City    = cityName;
            ViewBag.IsError = _weather.IsError;
            return(View(rt));
        }