请耐心等待我对此很陌生: 我目前使用.Net neo4jClient。目前我有一个分享节点和一个客户节点。我正在创建他们之间的关系CustomerOwnsShare并坚持它。我如何检索Neo4j图形数据库中的关系
这里是我的关系类
public class CustomerOwnsShare :
Relationship,
IRelationshipAllowingSourceNode<Customer>,
IRelationshipAllowingTargetNode<Share>
{
public CustomerOwnsShare(NodeReference targetNode)
: base(targetNode)
{
}
public int Quantity { get; set; }
public float CostPerShare { get; set; }
public string DateOfPurchase { get; set; }
public string ShareSymbol { get; set; }
public const string TypeKey = "CUSTOMER_OWNS_SHARE";
public override string RelationshipTypeKey
{
get { return TypeKey; }
}
}
我们检索关系的列表,从我使用LINQ如下
IEnumerable<RelationshipInstance> relationshipInstances =
graphClient.RootNode.In<Customer>(CustomerBelongsTo.TypeKey, c => c.Email == email)
.OutE(CustomerOwnsShare.TypeKey)
数据库回来,但这个返回我RelationshipInstance对象,没有按没有我需要的数据(数量,CostPerShare等)。
RelationshipInstance暴露了RelationshipReference对象,但即使这并不能帮助我找回我的实际关系对象。 在挖得更深一些,我知道我可以执行原小鬼查询如下
graphClient.ExecuteGetAllRelationshipsGremlin<>()
但该函数签名也返回我RelationshipInstance的IEnumerable。
任何想法或建议,我如何检索我的实际持久关系对象与它的数据?
由于提前