Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 public ActionResult Create(CountyViewModel countyViewModel)
 {
     if (ModelState.IsValid)
     {
         var county = Mapper.Map <County>(countyViewModel);
         countyService.Insert(county);
         return(RedirectToAction("Index"));
     }
     return(View(countyViewModel));
 }