Пример #1
0
        public TEntity[] Filter(IExpressionSpecification <TEntity> specification)
        {
            IQueryable <TEntity> entities = dbSet;

            IQueryable <TEntity> query = entities.Where(specification.ToExpression());

            return(query.ToArray());
        }
Пример #2
0
        public TEntity[] Filter(IExpressionSpecification <TEntity> specification)
        {
            IQueryable <TEntity> entities = set;

            if (specification.Includes.Length > 0)
            {
                foreach (string include in specification.Includes)
                {
                    entities = entities.Include(include);
                }
            }

            IQueryable <TEntity> query = entities.Where(specification.ToExpression());

            return(query.ToArray());
        }