0
votes

I'm new to Neo4jClient and seem to be having an issue I can't spot. I have what, I think, is an almost exact copy of the "Get Specific User" example from the documentation page: https://github.com/Readify/Neo4jClient/wiki/cypher-examples

But, the query seems to be returning the cypher query string, not the query result.

My code:

var result = client.Cypher
                .Match("(emUser:User)")
                .Where((Em317UserBo emUser) => emUser.Id == userId)
                .Return(emUser => emUser.As<Em317UserBo>());
            return (Em317UserBo)result;

I would think the last line is redundant, I was just experimenting. Once the query executes, result has the value :

"MATCH (emUser:User)   WHERE (emUser.Id = d5f9d635-d2e2-426d-b3c5-b215ea0405ac)   RETURN emUser"

Looks like a good query, but why isn't it executing? Any help would be greatly appreciated

1

1 Answers

3
votes

You need to ask for the results:

var result = client.Cypher
    .Match("(emUser:User)")
    .Where((Em317UserBo emUser) => emUser.Id == userId)
    .Return(emUser => emUser.As<Em317UserBo>())
    .Results;                                    // <---- You need this line
return (Em317UserBo)result;