コード例 #1
0
        public ActionResult GetWeather(string countryname, string cityname)
        {
            ContentResult result = null;

            try
            {
                Weather weather = globalWeatherServiceClient.GetWeatherDetails(cityname, countryname);
                result = Content(JsonConvert.SerializeObject(weather), "application/json");
            }
            catch (Exception ex)
            {
                mLog.Error(ex.InnerException.Message);
                Response.Write(ex.InnerException.Message);
            }
            return(result);
        }