Exemple #1
0
 public bool Register(string login, string email, string password)
 {
     if (!model_Users.Users.Any(el => el.Login == login))
     {
         User user = new User()
         {
             Login = login, Email = email, PasswordHash = Model_Users.GetHash(SHA256.Create(), password)
         };
         model_Users.Users.Add(user);
         model_Users.SaveChanges();
         return(true);
     }
     return(false);
 }