Ejemplo n.º 1
0
        public ActionResult Weather([Bind(Include = "Name, Country, County")] Geoname geoname, string screenName, int locationID)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var model   = new HomeIndexViewModel();
                    var service = new WeatherService();
                    model.Weathers = service.FindWeathers(geoname, screenName, locationID);


                    return(View("Weather", model));
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError(String.Empty, ex.Message);
            }

            return(View("Error"));
        }