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"); } }
public virtual IEnumerable <TEntity> Query(IQueryAdapter <TEntity> queryAdapter, int?skip = null, int?take = null) { var query = queryAdapter.BuildQuery(); return(DbSet.Where(query)); }