Example #1
0
        public override Expression <Func <T, bool> > ToExpression()
        {
            var expression    = _specification.ToExpression();
            var notExpression = Expression.Not(expression.Body);

            return(Expression.Lambda <Func <T, bool> >(notExpression, expression.Parameters.Single()));
        }
Example #2
0
        public override Expression <Func <T, bool> > ToExpression()
        {
            var leftExpression  = _left.ToExpression();
            var rightExpression = _right.ToExpression();

            var invokedExpression = Expression.Invoke(rightExpression, leftExpression.Parameters);

            return((Expression <Func <T, bool> >)Expression.Lambda(Expression.OrElse(leftExpression.Body, invokedExpression), leftExpression.Parameters));
        }