Exemplo n.º 1
0
 public async Task <IActionResult> Create(CategoryAddModel model)
 {
     TempData["active"] = "category";
     if (ModelState.IsValid)
     {
         await _categoryApiService.AddAsync(model);
     }
     return(View(model));
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Create(CategoryAddModel model)
        {
            if (ModelState.IsValid)
            {
                await _categoryApiService.AddAsync(model);

                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create(CategoryAddModel categoryAddModel)
        {
            TempData["active"] = "category";
            if (ModelState.IsValid)
            {
                await _categoryApiService.AddAsync(categoryAddModel);

                return(RedirectToAction("Index"));
            }
            return(View(categoryAddModel));
        }