예제 #1
0
        public ActionResult Create(CityViewModel cityViewModel)
        {
            var userId = User.Identity.GetUserId();

            _cityServices.Create(cityViewModel, userId);

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult Create(CityViewModel cityViewModel)
        {
            if (ModelState.IsValid)
            {
                var userId = User.Identity.GetUserId();
                _cityServices.Create(cityViewModel, userId);

                return(RedirectToAction("Index"));
            }

            return(View("CityForm", cityViewModel));
        }