예제 #1
0
        public bool createAccount(Player playerModel)
        {
            AccountContext accountContext = new AccountContext();

            if (accountContext.Create(playerModel))
            {
                return(true);
            }

            return(false);
        }
예제 #2
0
 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"));
     }
 }