/// <summary> /// Visits the children of the <see cref="T:System.Linq.Expressions.UnaryExpression"/>. /// </summary> /// <returns> /// The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. /// </returns> /// <param name="node">The expression to visit.</param> protected override Expression VisitUnary(UnaryExpression node) { if (node.NodeType == ExpressionType.Not) { _writer.NotOperater = true; } //if ((node.Operand is LambdaExpression) && (((LambdaExpression)node.Operand).Body is MemberExpression)) // base.Visit(node.Operand); if (!(node.Operand is MemberExpression)) { return(base.VisitUnary(node)); } Visit(node.Operand); if (QueryHelper.IsBoolean(node.Operand.Type) && !QueryHelper.IsHasValue(node.Operand)) { _writer.Boolean(!QueryHelper.IsPredicate(node)); } return(node); }