public IActionResult Create([Bind("Name,CityId,Id,CreateDate,CreatedBy,UpdateDate,UpdatedBy,IPAddress")] County county) { if (ModelState.IsValid) { countyService.Insert(county); return(RedirectToAction(nameof(Index))); } return(View(county)); }
public ActionResult Create(CountyViewModel countyViewModel) { if (ModelState.IsValid) { var county = Mapper.Map <County>(countyViewModel); countyService.Insert(county); return(RedirectToAction("Index")); } return(View(countyViewModel)); }