public bool createAccount(Player playerModel) { AccountContext accountContext = new AccountContext(); if (accountContext.Create(playerModel)) { return(true); } return(false); }
public IActionResult Register(User user) { if (ModelState.IsValid) { if (context.Users.Any(u => u.Email == user.Email)) { ModelState.AddModelError("Email", "Email already exist!"); return(View("Registration")); } else { UserSession = context.Create(user); return(Redirect("/success")); } } else { return(View("Registration")); } }