Please bear with me I'm new to this: I'm currently using the .Net neo4jClient. Currently I have a Share node and a Customer node. I'm creating a relationship CustomerOwnsShare between them and persisting it.
Here's my Relationship class
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; }
}
}
Now to retrieve a list of Relationships back from the Database I'm using Linq as below
IEnumerable<RelationshipInstance> relationshipInstances =
graphClient.RootNode.In<Customer>(CustomerBelongsTo.TypeKey, c => c.Email == email)
.OutE(CustomerOwnsShare.TypeKey)
But this returns me RelationshipInstance object which doesn't have the data that i need(Quantity, CostPerShare, etc.).
RelationshipInstance exposes a RelationshipReference Object, but even that doesn't help me retrieve my actual Relationship Object. On digging a little deeper i see that i can execute Raw gremlin query as below
graphClient.ExecuteGetAllRelationshipsGremlin<>()
but the function signature of that also returns me an IEnumerable of RelationshipInstance.
Any ideas or suggestions on how i can retrieve my actual persisted Relationship object with it's data ??
Thanks in Advance