Пример #1
0
        public async Task <IActionResult> Create(BrandInputModel model)
        {
            var serviceModel = this.mapper.Map <BrandModel>(model);
            var foodBrandId  = await this.brandService.Create(serviceModel);

            return(this.Created($"/foods/{foodBrandId}/brands", foodBrandId));
        }
Пример #2
0
 public async Task <IActionResult> CreateBrand(BrandInputModel model)
 => await this.Handle(
     async() =>
 {
     await this.foodBrandService.CreateBrand(model);
 },
     success : RedirectToAction(nameof(HomeController.Index), "Home"),
     failure : View(nameof(Create), model));