Search code examples
neo4jcypherneo4jclient

how to use WithParam more than once in Neo4jClient?


Hello i want to use two parameters in one line of query see example query down,

client.cypher.Match("(p:Person)")
             .Where("NOT (p)-[:KHOWS]-(:Person {Id:{param}})-[:HAS_PROFILE]-(:Profile {Id:{param2}})")

now how can i use WithParam() for both parameters in one line?


Solution

  • You can either call .WithParam() 2x, like:

    .WithParam("Param1", xx)
    .WithParam("Param2", yy)
    

    Or use .WithParams:

    .WithParams(new {
        param1 = xx,
        param2 = yy
    })
    

    There is no performance difference between the two.