Пример #1
0
        public async Task <IActionResult> Edit(int id)
        {
            BrandServiceModel brandServiceModel = await this.brandService.GetBrandByIdAsync(id);

            BrandEditInputModel brandEditInputModel = brandServiceModel.To <BrandEditInputModel>();

            return(this.View(brandEditInputModel));
        }
Пример #2
0
        public async Task <IActionResult> Edit(BrandEditInputModel brandEditInputModel)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(brandEditInputModel));
            }

            await this.brandService.EditAsync(brandEditInputModel.To <BrandServiceModel>());

            return(this.RedirectToAction("All", "Brands"));
        }