.NET Graph Client CRUD Help Thanks!

Hi Guys,

I posted this in the Cypher category but wasn't sure if it was better to post here because it is using the .NET Graph Client?

Should I re-post it here or is the link above ok?

Any help would be really appreciated thanks. :slight_smile:

Cheers
D.

Anyone? :slight_smile:

Have you tried replacing {nameParam} with $nameParam? The latter is the parameter syntax for neo4j 4+.

Sorry for the late response. With the old parm inclusion syntax you've got two issues.

  1. Need to have the $ at the beginning of the string for interpolation.
  2. to interpolate strings you need to escape the existing {} that you want sent as part of the cypher.

So you'd want this:

GraphClient.Cypher.Match($"(p:Avatar {{Username: {nameParam}}})")

OR if you want to use the recommended neo4j params, which I suspect you're doing with the WithParam

Use $nameParam

GraphClient.Cypher.Match("(p:Avatar {Username: $nameParam})").WithParam("nameParam", username)

Hope that helps!