public IList <T> GetAll(Expression <Func <T, bool> > predicate = null, params Expression <Func <T, object> >[] includeProperties) { IQueryable <T> query = _dbContext.Set <T>(); if (predicate != null) { query = query.Where(predicate); } if (includeProperties.Any()) { foreach (var item in includeProperties) { query = query.Include(item); } } return(query.ToList()); }
public EfRepository(WorkFollowDataContext dbContext) { _dbContext = dbContext; this.dbSet = _dbContext.Set <T>(); }