0

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 Answer 1

3

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;
Sign up to request clarification or add additional context in comments.

1 Comment

Easy enough. Thanks a million

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.