Пример #1
0
        public async Task <IActionResult> Create(AppUser appUser)
        {
            if (ModelState.IsValid)
            {
                context.Add(appUser);
                await context.SaveChangesAsync();

                TempData["Success"] = "The page has been added!";

                return(RedirectToAction("Index"));
            }

            return(View(appUser));
        }
Пример #2
0
        public async Task <IActionResult> Create(SportsCategory sportsCategory)
        {
            if (ModelState.IsValid)
            {
                context.Add(sportsCategory);
                await context.SaveChangesAsync();

                TempData["Success"] = "The category has been added!";

                return(RedirectToAction("Index"));
            }

            return(View(sportsCategory));
        }