protected override Expression VisitFunctionCall(SqlFunctionCallExpression functionCallExpression)
        {
            if (this.inProjector)
            {
                return(functionCallExpression);
            }

            if (functionCallExpression.Arguments.Count == 1 &&
                (functionCallExpression.Function == SqlFunction.IsNotNull || functionCallExpression.Function == SqlFunction.IsNull) &&
                (functionCallExpression.Arguments[0].NodeType == ExpressionType.MemberInit || functionCallExpression.Arguments[0].NodeType == (ExpressionType)SqlExpressionType.ObjectReference))
            {
                Expression retval = null;

                foreach (var value in ObjectOperandComparisonExpander.GetPrimaryKeyElementalExpressions(functionCallExpression.Arguments[0]))
                {
                    var current = new SqlFunctionCallExpression(functionCallExpression.Type, functionCallExpression.Function, value);

                    if (retval == null)
                    {
                        retval = current;
                    }
                    else
                    {
                        retval = Expression.And(retval, current);
                    }
                }

                return(retval);
            }

            return(base.VisitFunctionCall(functionCallExpression));
        }
        public static Expression Expand(Expression expression)
        {
            var expander = new ObjectOperandComparisonExpander();

            return expander.Visit(expression);
        }
        public static Expression Expand(Expression expression)
        {
            var expander = new ObjectOperandComparisonExpander();

            return(expander.Visit(expression));
        }