Пример #1
0
        public async Task <IActionResult> CreateCity(CreateCityViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var createModel = _mapper.Map <CityServiceModel>(model);

            createModel.Country = await _nomenclatureService.GetCountry(model.CountryId);

            await _adminService.CreateCity(createModel);

            return(RedirectToAction(nameof(Cities)));
        }