所以我有一個描述關係,像這樣一類:的方法的類型參數不能從使用錯誤推斷創建關係
public class GraphRelationship<TObject> : Relationship<RelationshipObject>, IRelationshipAllowingSourceNode<TObject>, IRelationshipAllowingTargetNode<TObject>
{
string RelationshipName;
public GraphRelationship(string RelationshipName, NodeReference targetNode, RelationshipObject relationshipTypeObject)
: base(targetNode, relationshipTypeObject)
{
this.RelationshipName = RelationshipName;
}
public override string RelationshipTypeKey
{
get { return RelationshipName; }
}
}
現在我有,我想用它來創建一個方法上面提到的類的一個實例,但是我得到這個The type arguments for method cannot be inferred from the usage
錯誤。
這裏是方法:
public RelationshipReference CreateObjectRelationship(string relationshipType, string parentObjectId, string childObjectId, RelationshipObject relationshipProperties)
{
RelationshipReference relationshipReference = 0;
NodeReference parentNodeReference = GetObjectReference(parentObjectId);
NodeReference childNodeReference = GetObjectReference(childObjectId);
//This is where the error is
relationshipReference = GraphConnection.CreateRelationship(parentNodeReference, new GraphRelationship<RelationshipObject>(relationshipType, childNodeReference, relationshipProperties));
return relationshipReference;
}
我敢肯定,這是一個很重要的問題,但我怎麼解決這一問題?
API的哪些部分已經過時,我們正在使用客戶端相當廣泛。 –
基本上任何在代碼路徑中都沒有「Cypher」的地方。這與Neo4j本身的方向一致。 本週,我將與其他司機作家一起在聖弗蘭的Neo辦公室花費幾天的時間,然後花時間就此發佈更好的指導。 –
太棒了,謝謝! –