public ICypherQuery Execute(ICypherQuery query) { query = query .Match(StatementFactory.Match(_node, StatementFactory.IdParameter(_node))) .WithParam(StatementFactory.IdParameter(_node), _node.Id) .DetachDelete($"{StatementFactory.ExistingNode(_node)}"); return(query); }
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 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 ShouldCreateMergeStatement() { var factory = new AttributeMetadataFactory(new NullLogger()); var person = new Person { Id = "1" }; var node = new Node(factory.Create(person), person); var id = StatementFactory.IdParameter(node); var result = StatementFactory.Merge(node, id); Assert.Equal("(Person_1:Person { Id:{Person_1_id}})", result); }
public ICypherQuery Execute(ICypherQuery query) { var node = StatementFactory.Parameter(_node); var id = StatementFactory.IdParameter(_node); var merge = StatementFactory.Merge(_node, id); var set = StatementFactory.Set(_node, node); query = query .Merge(merge) .OnCreate() .Set(set) .OnMatch() .Set(set) .WithParam(node, _factory().ToDictionary()) .WithParam(id, ProxyUtils.GetEntityId(_node)); return(query); }