public async Task <User> Register(User user, string password)
        {
            byte[] passwordHash, passwordSalt;
            CreatePssswordHash(password, out passwordHash, out passwordSalt);
            user.PasswordHash = passwordHash;
            user.PasswordSalt = passwordSalt;
            await _context.Users.AddAsync(user);

            await _context.SaveChangesAsync();

            return(user);
        }
예제 #2
0
 public async Task <bool> SaveAll()
 {
     return(await _appContext.SaveChangesAsync() > 0);
 }