public override Expression <Func <T, ValidationResult, bool> > ToExpression() { var expression = _specification.ToExpression(); var notExpression = Expression.Not(expression.Body); return(Expression.Lambda <Func <T, ValidationResult, bool> >(notExpression, expression.Parameters)); }
public override Expression <Func <T, ValidationResult, bool> > ToExpression() { var leftExpression = _left.ToExpression(); var rightExpression = _right.ToExpression(); var invokedExpression = Expression.Invoke(rightExpression, leftExpression.Parameters); return((Expression <Func <T, ValidationResult, bool> >)Expression.Lambda(Expression.AndAlso(leftExpression.Body, invokedExpression), leftExpression.Parameters)); }