这是一个两部分的问题
当我尝试创建新节点时出现此错误
无法将类型“Neo4jClient.NodeReference”隐式转换为“Neo4jClient.GraphClient”
我这里有 3 个类第一个连接到 GraphDB 服务器并返回客户端变量以供以后在其他类中使用
public GraphClient GetConnection()
{
var client = new GraphClient(new Uri("http://localhost:7474/db/data"));
client.Connect();
return client;
}
然后是 New_Node 类,看起来像这样
class New_Node
{
public GraphClient Node { get; set; }
}
然后是具有 CreateNode 方法的 Graph Operations 类
public GraphClient CreateNode()
{
Graph_Connection connection = new Graph_Connection();
var NewNode = connection.GetConnection();
var Created_Node = NewNode.Create(new New_Node());
return Created_Node;
}
如何在另一行代码上设置节点的属性而不是使用节点创建它们,我想让我的应用程序更加动态,因为这种方式似乎很难编码
var refA = client.Create(new Person() { Name = "Person A" });
在Java中可以做到这一点
Node user1 = this.graphDb.createNode();
user1.setProperty("name", "Mike");