示例#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()));
        }
示例#2
0
        public override Expression <Func <T, bool> > ToExpression()
        {
            var leftExpression  = _left.ToExpression();
            var rightExpression = _right.ToExpression();
            var andExpression   = Expression.AndAlso(leftExpression.Body, rightExpression.Body);

            return(Expression.Lambda <Func <T, bool> >(andExpression, leftExpression.Parameters.Single()));
        }