public User Authenticate(string username, string password) { if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) { return(null); } var user = _context.Set <User>().FirstOrDefault(x => x.UserName == username); // check if username exists if (user == null) { return(null); } // check if password is correct if (!VerifyPasswordHash(password, user.PasswordHash, user.PasswordSalt)) { return(null); } // authentication successful return(user); }
public BaseRepository(ETicaretContext context) { Context = context; Entity = context.Set <T>(); }
public DbSet <T> Set() { return(_db.Set <T>()); }
public DbSet <T> GetTable() { return(_context.Set <T>()); }