Ejemplo n.º 1
0
        public ActionResult Insert()
        {
            var model = new CityCountries
            {
                Countries = countryRepository.Countries.ToList(),
                City = new City()
            };

            return View(model);
        }
Ejemplo n.º 2
0
        public ActionResult Insert(CityCountries cityCountry)
        {
            if (ModelState.IsValid)
            {
                var city = cityCountry.City;
                cityRepository.Save(city);
                return RedirectToAction("List");
            }

            return View(cityCountry);
        }