private void TranformList(NEORSTNode Parent, List <NEORSTNode> state) { state.Add(Parent); foreach (var relation in Parent.Relations) { TranformList(relation.Child, state); } }
public void CreateRelation(NEO.NEORSTRelation Relation, NEO.NEORSTNode Parent, NEO.NEORSTNode Child, IGraphClient client) { client.Cypher .Match("(a:RSTNode)", "(b:RSTNode)") .Where((RSTNode a) => a.name == Parent.name) .AndWhere((RSTNode b) => b.name == Child.name) .CreateUnique(string.Format("(a)-[r:RSTRelation {{ kind: '{0}'}}]->(b)", Relation.relation)) .ExecuteWithoutResults(); }
private void InternalSave(NEO.NEORSTNode Node, IGraphClient Client) { this.CreateNode(Node, Client); foreach (var rel in Node.Relations) { InternalSave(rel.Child, Client); this.CreateRelation(rel, Node, rel.Child, Client); } }
public void CreateNode(NEO.NEORSTNode Node, IGraphClient client) { client.Cypher.Merge("(d:RSTNode { name : {name}})").OnCreate() .Set("d = {newObject}") .WithParams( new { name = Node.name, newObject = Node } ).ExecuteWithoutResults(); }