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)); }
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)); }