Esempio n. 1
0
        public ActionResult Index([Bind(Include = "ScreenName")] HomeIndexViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var service = new WeatherService();
                    model.Geoname = service.FindLocations(model.ScreenName);
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(String.Empty, ex.Message);
            }

            return(View("Index", model));
        }