Ejemplo n.º 1
0
        public async Task <IActionResult> Create(Student p)
        {
            if (ModelState.IsValid)
            {
                await StudentDb.AddAsync(p, context);

                ViewData["Message"] = $"{p.Name} was added!";
                return(RedirectToAction("Index"));
            }

            //Show web page with errors
            return(View(p));
        }