public IActionResult Contact() { string userAgent = Request.Headers["User-Agent"].ToString(); var cities = ServiceProxyUtil.InvokeService <IWeatherService, string>(ServiceProxyUtil.GetServiceUri("Weather"), (weatherService) => { return(weatherService.GetSupportCity("辽宁")); }, new CustomContextDataDto { ID = userAgent, Name = DateTime.Now.ToString() }).Result; ViewData["Message"] = cities; return(View()); }
public IActionResult About() { string userAgent = Request.Headers["User-Agent"].ToString(); var weather = ServiceProxyUtil.InvokeService <IWeatherService, string>(ServiceProxyUtil.GetServiceUri("Weather"), (weatherService) => { return(weatherService.GetCurrentWeather("北京")); }, new CustomContextDataDto { ID = userAgent, Name = DateTime.Now.ToString() }).Result; ViewData["Message"] = weather; return(View()); }