public ActionResult Create(CountryViewModel model) { if (ModelState.IsValid) { _countryManager.Add(_countryFieldCopier.CopyFields(model, new Country())); return(RedirectToAction("List")); } return(View(model)); }
public IActionResult Create(Country aCountry) { if (ModelState.IsValid) { bool isAdd = _iCountryManager.Add(aCountry); if (isAdd) { return(RedirectToAction("Index")); } else { return(ViewBag.ErrorMessage = "Country save failed!"); } } return(View(aCountry)); }