//register a user public async Task <User> Register(User user, string password) { byte[] PasswordSalt, PasswordHash; PasswordHashGenerator(password, out PasswordHash, out PasswordSalt); user.PasswordHash = PasswordHash; user.PasswordSalt = PasswordSalt; await _context.Users.AddAsync(user); await _context.SaveChangesAsync(); return(user); }
public async Task <bool> SaveAll() { return(await _context.SaveChangesAsync() > 0); }