public void CreateNode() { Node node = new Node(); node.AddProperty("FirstName", "Kunjachan"); node.AddProperty("LastName", "Arouje"); node.Create(); Assert.IsNotNull(node.GetLocation()); Console.WriteLine(node.GetLocation().ToString()); Node mother = new Node(); mother.AddProperty("FirstName", "Marry").AddProperty("LastName", "Treassa").Create(); Assert.IsNotNull(mother.GetLocation()); Console.WriteLine(mother.GetLocation().ToString()); }
public void RemoveNode(Node node) { if (node.GetLocation() == null) throw new InvalidNodeException(); _indexRepo.RemoveNodeFromIndex(this,node); }
public Relationship CreateRelationshipTo(Node node, string relationShipType) { if ((this.GetLocation()==null) || (node.GetLocation()==null)) throw new Exception("Parent or child node is not created. Create both node before creating the relation"); Relationship relationShip = new Relationship(this, node, relationShipType); return _relationShipRepo.CreateRelationship(this, relationShip); }
public Index Add(Node node, string key, string value) { if (node.GetLocation() == null) throw new InvalidNodeException(); _indexRepo.AddNodeToIndex(this,node, key, value); return this; }
public void RemoveNode(Node node) { if (node.GetLocation() == null) { throw new InvalidNodeException(); } _indexRepo.RemoveNodeFromIndex(this, node); }
public Index Add(Node node, string key, string value) { if (node.GetLocation() == null) { throw new InvalidNodeException(); } _indexRepo.AddNodeToIndex(this, node, key, value); return(this); }
public Relationship CreateRelationshipTo(Node node, string relationShipType) { if ((this.GetLocation() == null) || (node.GetLocation() == null)) { throw new Exception("Parent or child node is not created. Create both node before creating the relation"); } Relationship relationShip = new Relationship(this, node, relationShipType); return(_relationShipRepo.CreateRelationship(this, relationShip)); }
public Node GetNode(Node node) { var result = _graphRequest.Post(RequestType.GET, node.GetLocation(), null); node.SetResult(result); return node; }
public RequestResult GetRestExecutionResult(Node node, string query) { //Console.WriteLine(query); var uri = UriHelper.ConcatUri(node.GetLocation(), "/traverse/node"); var result = _graphRequest.Post(RequestType.POST, uri, query); return result; }
public RequestResult GetRelatedNodes(Node node, string direction) { RequestResult result = _graphRequest.Post(RequestType.GET, new Uri(string.Concat(node.GetLocation(), @"/relationships/", direction)), null); return result; }
internal Relationship(Node startNode, Node endNode, string relationShipType) : this() { _toNodeLocation = endNode.GetLocation().ToString(); _type = relationShipType; }
public void DeleteNode() { Node nodeToDelete = new Node(); nodeToDelete.AddProperty("FirstName", "Delete").AddProperty("LastName", "Node"); nodeToDelete.Create(); int id = nodeToDelete.Id; Console.WriteLine(nodeToDelete.GetLocation().ToString()); nodeToDelete.Delete(); Node accessDeletedNode = Node.Get(id); Assert.AreEqual(0, accessDeletedNode.Id); }
public Relationship CreateRelationship(Node parent, Relationship relationShip) { var result = _graphRequest.Post(RequestType.POST, new Uri(string.Concat(parent.GetLocation(), @"/relationships")), relationShip.GetProperties()); relationShip.SetLocation(result.GetLocation()); return relationShip; }