Пример #1
0
        public async Task <IActionResult> Create(BlogAddModel model)
        {
            if (ModelState.IsValid)
            {
                await _blogApiService.AddAsync(model);

                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
        public async Task <IActionResult> Create(BlogAddModel blogAddModel)
        {
            TempData["active"] = "blog";
            if (ModelState.IsValid)
            {
                await _blogApiService.AddAsync(blogAddModel);

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