public ICypherQuery Execute(ICypherQuery query) { query .With(StatementFactory.With(_source)) .Match(StatementFactory.Match(_destination, StatementFactory.IdParameter(_destination))) .CreateUnique(StatementFactory.Relationship(_source, _destination, _relationship)) .WithParam(StatementFactory.IdParameter(_destination), _destination.Id); return(query); }
public void ShouldCreateReverseRelationshipStatement() { var metadata = new RelationshipMetadata { Name = "REL", IsReverse = true }; var result = StatementFactory.Relationship(metadata); Assert.Equal("<-[:REL]-", result); }
public void ShouldCreateNamedRelationshipStatement() { var metadata = new RelationshipMetadata { Name = "REL", IsReverse = false }; var result = StatementFactory.Relationship(metadata, "x"); Assert.Equal("-[x:REL]->", result); }
public ICypherQuery Execute(ICypherQuery query) { query = query .With(StatementFactory.With(_source)) .Match(StatementFactory.Match(_destination, StatementFactory.IdParameter(_destination))) .Match(StatementFactory.Relationship(_source, _destination, _relationship, _relationshipName)) .WithParam(StatementFactory.IdParameter(_destination), _destination.Id) .Delete(GetNodesToDelete()); return(query); }
public void ShouldCreateNamedRelationship() { var factory = new AttributeMetadataFactory(new NullLogger()); var personA = new Person { Id = "A" }; var nodeA = new Node(factory.Create(personA), personA); var personB = new Person { Id = "B" }; var nodeB = new Node(factory.Create(personB), personB); var relationship = new RelationshipMetadata { Name = "REL", IsReverse = true }; var result = StatementFactory.Relationship(nodeA, nodeB, relationship, "r"); Assert.Equal("(Person_A)<-[r:REL]-(Person_B)", result); }