cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

.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.

Cheers
D.

3 REPLIES 3

Anyone?

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

mdfrenchman
Graph Voyager

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!