コード例 #1
0
        public async Task <IActionResult> Create()
        {
            var address = new CustomersAddressInputModel
            {
                Cities = await this.addressService.GetCitiesByCountryAsync <CityViewModel>(GlobalConstants.CountryOfUsing)
                         as ICollection <CityViewModel>,
            };

            return(this.PartialView("_CreatePartial", address));
        }
コード例 #2
0
        public async Task <IActionResult> Create(CustomersAddressInputModel address)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.PartialView("_CreatePartial", address));
            }

            await this.addressService.CreateAsync(address);

            return(this.PartialView("_CreatePartial", address));
        }