예제 #1
0
        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());
        }
예제 #2
0
 public EfRepository(WorkFollowDataContext dbContext)
 {
     _dbContext = dbContext;
     this.dbSet = _dbContext.Set <T>();
 }