public async Task <User> Register(User user, string password) { byte[] passwordHash, passwordSalt; CreatePasswordHash(password, out passwordHash, out passwordSalt); user.PasswordHash = passwordHash; user.PasswordSalt = passwordSalt; await _context.User.AddAsync(user); await _context.SaveChangesAsync(); return(user); }
public async Task <bool> SaveAll() { return(await _context.SaveChangesAsync() > 0); //more than 0 results = true, 0 results = false }