Exemplo n.º 1
0
        public IActionResult Create(City aCity)
        {
            if (ModelState.IsValid)
            {
                bool isAdd = _iCityManager.Add(aCity);

                if (isAdd)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    return(ViewBag.ErrorMessage = "City save failed!");
                }
            }

            ViewBag.CountryList = GetAllCountry();
            return(View(aCity));
        }