所以我有一个描述关系,像这样一类:的方法的类型参数不能从使用错误推断创建关系
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办公室花费几天的时间,然后花时间就此发布更好的指导。 –
太棒了,谢谢! –