public ActionResult getWeather(string city, string state)
        {
            //string city = Request["city"];
            //string state = Request["state"];
            mainPageViewModel = new MainPageViewModel();
            yrNoApi = new YrNoAPI();

            mainPageViewModel.City = city;
            mainPageViewModel.State = state;

            mainPageViewModel.FiveDaysOfWeather= yrNoApi.getWeatherFromYR(state, city);

            return View("Index", mainPageViewModel);
        }
        public ActionResult Search([Bind(Include = "SearchString")] WeatherApp.Models.SearchViewModel search)
        {
            mainPageViewModel = new MainPageViewModel();
            geonamesApi = new GeoNamesAPI();

               if (ModelState.IsValid)
            {
            var cities = _repository.SearchCities(search.SearchString);

                if (cities.Count() == 0)
                {
                    cities = geonamesApi.getNames(search.SearchString);

                    if (cities.Count() == 0)
                    {
                        mainPageViewModel.NoCities = true;

                    }
                    int i = 0;
                    foreach (var city in cities)
                    {
                        city.CityID = i++;
                        _repository.Add(city);
                    }

                    _repository.Save();

                }
                if (cities.Count == 1)
                {
                    return getWeather(cities.First().Name, cities.First().State);
                }

                mainPageViewModel.Cities = cities;
            }
            return View("Index", mainPageViewModel);
        }