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); }