public ActionResult Create(CityViewModel cityViewModel) { var userId = User.Identity.GetUserId(); _cityServices.Create(cityViewModel, userId); return(RedirectToAction("Index")); }
public ActionResult Create(CityViewModel cityViewModel) { if (ModelState.IsValid) { var userId = User.Identity.GetUserId(); _cityServices.Create(cityViewModel, userId); return(RedirectToAction("Index")); } return(View("CityForm", cityViewModel)); }