I am using the Neo4jClient and am trying to start at a parent node and get all related nodes and relationships to build and return an Object.
The object is simply:
public class NodeModel
{
public string Key {get; set;}
public IEnumerable<EdgeModel> Edges {get; set;}
}
public class EdgeModel
{
public string Key {get; set;}
public string EdgeType {get; set;}
public IEnumerable<NodeModel> ChildNodes {get; set;}
}
and an example of the nodes and edges I am trying to return is:

How can I write a query using the neo4jclient that will return the nodes and edges as my NodeModel object or something close that I can work with programmatically. When trying something like:
_graphClient.Cypher
.Match("(parentNode:TestLabel WHERE parentNode.Key = $key)")
.OptionalMatch("(parentNode)->[r:RELATED_TO*]->(childNode:TestLabel)")
I'm not sure what to return and how to process the results in a way that fits my model. Also, I would prefer not use the APOC plugin if possible.
Thanks for the help!