I have a Neo4j database, which for the sake of simplicity contains user nodes and university nodes - where the User can be connected to the university through the relation [: STUDENT_AT].
I want to return the user data and university information for a specific user, in this case, a query by the value "username".
The request itself works fine, however, I cannot develop the correct method to get the deserializer in Neo4jClient to give me two objects to work with. Below I believe that this should work, but alas, this does not happen.
graph.Cypher .Start("user", "node(*)") .Match("user-[:STUDENT_AT]->university") .Where<User>(user => user.Username != null && user.Username.ToLower() == username.ToLower()) .Return((user, university) => new { User = user.As<User>(), University = university.As<University>() }) .Results;
Where graph is IGraphClient successfully associated with Neo4j.
I get an error...
The response to the request contains the User, University columns, however <> f__AnonymousType0`2 [[XYZ.Entities.User, XYZ.Entities, Version = 1.0.0.0, Culture = Neutral, PublicKeyToken = null], [XYZ.Entities.University, XYZ.Entities, Version = 1.0.0.0, Culture = Neutral, PublicKeyToken = null]] does not contain publicly configured properties for receiving this data.
So, if anyone can provide me with a method to get objects from a cypher request that returns multiple columns using Neo4jClient, I would really appreciate it!