Beispiel #1
0
        public IQueryable <T> GetAll(string[] includes = null)
        {
            //HANDLE INCLUDES FOR ASSOCIATED OBJECTS IF APPLICABLE
            if (includes != null && includes.Count() > 0)
            {
                var query = _dbContext.Set <T>().Include(includes.First());
                foreach (var include in includes.Skip(1))
                {
                    query = query.Include(include);
                }
                return(query.AsQueryable());
            }

            return(_dbContext.Set <T>().AsQueryable());
        }
Beispiel #2
0
 public BaseRepository()
 {
     _dbContext = new DbQuanLyThuVienContext();
     dbSet      = _dbContext.Set <T>();
 }