Example #1
0
        public Expression <Func <TEntity, bool> > BuildQuery()
        {
            var otherExpression = _other.BuildQuery();

            if (_negateOther)
            {
                otherExpression = otherExpression.Not();
            }

            switch (Operator)
            {
            case Logical.And:
                return(otherExpression.And(BuildQueryCore()));

            case Logical.Or:
                return(otherExpression.Or(BuildQueryCore()));

            case Logical.Xor:
                return(otherExpression.XOr(BuildQueryCore()));

            default:
                throw new NotImplementedException("Unknown Logical");
            }
        }
Example #2
0
        public virtual IEnumerable <TEntity> Query(IQueryAdapter <TEntity> queryAdapter, int?skip = null, int?take = null)
        {
            var query = queryAdapter.BuildQuery();

            return(DbSet.Where(query));
        }