Beispiel #1
0
        private static Filter Equal(BinaryExpression node)
        {
            Log.WriteLine(string.Format("    -> Equal        : {0}", node));
            Log.WriteLine(string.Format("    -> Left         : {0}", node.Left));
            Log.WriteLine(string.Format("    -> Right        : {0}", node.Right));

            return(new TermFilter {
                Term = TermParser.Parse <object>(node.Left, node.Right)
            });
        }
Beispiel #2
0
        private static Filter EnumerableContains(Expression left, Expression right)
        {
            Log.WriteLine(string.Format("    -> Left         : {0}", left));
            Log.WriteLine(string.Format("    -> Right        : {0}", right));

            if (left is MemberExpression)
            {
                return(new TermFilter {
                    Term = TermParser.Parse <object>(left, right)
                });
            }

            if (right is MemberExpression)
            {
                return(new TermsFilter {
                    Terms = TermsParser.Parse(left, right)
                });
            }

            throw new Exception("invalid call to contains");
        }