Neo4jClient Call example failing

139 views Asked by At

The Call example for the .NET Neo4jClient listed on this page is listed below.

graphClient.Cypher
.Match("(user:User)")
.Where((User user) => user.Id == 1234)
.With("user, size((user)-[:IS_FRIENDS_WITH]->(:Friend)) as numberOfFriends")
.Call("apoc.map.setKey(user, 'numberOfFriends', numberOfFriends)").Yield("value AS userWithFriends")
.Return(userWithFriends => new {
    User = userWithFriends.As<User>()
})
.Results;

When I attempt to use this, I get the following error: Only assignment, call, increment, decrement, and new object expressions can be used as a statement

How can I address this?

1

There are 1 answers

0
Charlotte Skardon On BEST ANSWER

Are you getting the results and putting them anywhere?

Have you tried adding:

var results = to the beginning of your statement?