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

                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
예제 #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));
        }