public IActionResult Register(Member m) { if (ModelState.IsValid) { //add to db MemberDb.AddMember(m, _context); //redirect to index page return(RedirectToAction("Index", "Home")); } //returning view, with error messages return(View(m)); }
public IActionResult Register(Member m) { if (ModelState.IsValid) { //Add to DB MemberDb.AddMember(m, _context); SessionHelper.LogUserIn(_accessor, m.MemberID); //Redirect to index page return(RedirectToAction("Index", "Home")); } //Returning the same View, with error messages return(View(m)); }