public virtual IEnumerable <TEntity> GetAll(params Expression <Func <TEntity, object> >[] navigationProperties) { IQueryable <TEntity> dbQuery = _context.Set <TEntity>(); //Apply eager loading foreach (Expression <Func <TEntity, object> > navigationProperty in navigationProperties) { _dbQuery = _dbQuery.Include <TEntity, object>(navigationProperty); } return(_dbQuery .AsNoTracking() .ToList <TEntity>()); }
public Repository(CompassContext context) { _context = context; _dbQuery = context.Set <TEntity>(); }