Inheritance: System.Linq.Expressions.ExpressionVisitor
        public static string BuildText(
            LambdaExpression expression,
            Func<object, string> createParameterCallback,
            CypherCapabilities capabilities = null)
        {
            capabilities = capabilities ?? CypherCapabilities.Default;

            if (expression.NodeType == ExpressionType.Lambda &&
                expression.Body.NodeType == ExpressionType.MemberAccess)
                throw new NotSupportedException("Member access expressions, like Where(f => f.Foo), are not supported because these become ambiguous between C# and Cypher based on how Neo4j handles null values. Use a comparison instead, like Where(f => f.Foo == true).");

            var myVisitor = new CypherWhereExpressionVisitor(createParameterCallback, capabilities);
            myVisitor.Visit(expression);
            return myVisitor.TextOutput.ToString();
        }
Exemplo n.º 2
0
        public static string BuildText(
            LambdaExpression expression,
            Func <object, string> createParameterCallback,
            CypherCapabilities capabilities = null)
        {
            capabilities = capabilities ?? CypherCapabilities.Default;

            if (expression.NodeType == ExpressionType.Lambda &&
                expression.Body.NodeType == ExpressionType.MemberAccess)
            {
                throw new NotSupportedException("Member access expressions, like Where(f => f.Foo), are not supported because these become ambiguous between C# and Cypher based on how Neo4j handles null values. Use a comparison instead, like Where(f => f.Foo == true).");
            }

            var myVisitor = new CypherWhereExpressionVisitor(createParameterCallback, capabilities);

            myVisitor.Visit(expression);
            return(myVisitor.TextOutput.ToString());
        }