public ISqlFragment CompareTo(BinarySide right, string op)
            {
                if (Constant != null)
                {
                    return(right.CompareTo(this, WhereClauseParser.OppositeOperators[op]));
                }

                if (Comparable != null && right.Constant != null)
                {
                    return(Comparable.CreateComparison(op, right.Constant, MemberExpression));
                }

                if (Field == null)
                {
                    throw new BadLinqExpressionException("Unsupported binary value expression in a Where() clause");
                }

                if (right.Constant != null)
                {
                    return(Field.CreateComparison(op, right.Constant, MemberExpression));
                }

                if (right.Field != null)
                {
                    return(new ComparisonFilter(Field, right.Field, op));
                }

                throw new BadLinqExpressionException("Unsupported binary value expression in a Where() clause");
            }
Beispiel #2
0
            public ISqlFragment BuildWhereFragment(BinaryExpression node, string op)
            {
                _left  = analyze(node.Left);
                _right = analyze(node.Right);

                return(_left.CompareTo(_right, op));
            }