本文整理汇总了C#中IVertexType.GetAncestorVertexTypesAndSelf方法的典型用法代码示例。如果您正苦于以下问题:C# IVertexType.GetAncestorVertexTypesAndSelf方法的具体用法?C# IVertexType.GetAncestorVertexTypesAndSelf怎么用?C# IVertexType.GetAncestorVertexTypesAndSelf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVertexType
的用法示例。
在下文中一共展示了IVertexType.GetAncestorVertexTypesAndSelf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllSelectedAttributesFromVertex
//.........这里部分代码省略.........
continue;
}
if (attrSel is SelectionElementFunction)
{
#region Select a function
var selectionElementFunction = (attrSel as SelectionElementFunction);
if (selectionElementFunction.SelectValueAssignment != null &&
selectionElementFunction.SelectValueAssignment.ValueAssignmentType == SelectValueAssignment.ValueAssignmentTypes.Always)
{
Attributes.Item1.Add(alias, (selectionElementFunction.SelectValueAssignment.TermDefinition as ValueDefinition).Value);
continue;
}
#region Get the CallingObject
Object callingObject = null;
if (myUsingGraph)
{
//a special attribute has no RelatedGraphDBTypeUUID. So use myDBType to create an EdgeKey
//EdgeKey key = (selectionElementFunction.Element is ASpecialTypeAttribute) ? new EdgeKey(myDBType.UUID, selectionElementFunction.Element.UUID) : new EdgeKey(selectionElementFunction.Element);
EdgeKey key = new EdgeKey(selectionElementFunction.Element.RelatedType.ID, selectionElementFunction.Element.ID);
//the levelKey is created with the type inside the select -- f.e. FROM User SELECT Friends.TOP(2) -- it is 'User'
//we have to check if the levelKey contains an edge of the VertexType which is equal to the related type of the selection element
//this is neccessary -- f.e. FROM User SELECT Friends.TOP(2) -- if the edge 'FRIENDS' is not defined on type User
//in this case we have to check if there is a parent type of the reference type which is equal to the related type of the selection element
if (levelKey.Edges.All(x => x.VertexTypeID != selectionElementFunction.Element.RelatedType.ID))
{
if (myDBType.GetAncestorVertexTypesAndSelf().Select(x => x.ID).Contains(selectionElementFunction.Element.RelatedType.ID))
{
var typeID = myDBType.GetAncestorVertexTypesAndSelf().Select(x => x.ID).Where(x => x == selectionElementFunction.Element.RelatedType.ID).First();
levelKey = new EdgeList(typeID);
}
}
myUsingGraph = _ExpressionGraph.IsGraphRelevant(new LevelKey((levelKey + key).Edges, _graphdb, mySecurityToken, myTransactionToken), myDBObject);
}
if (myUsingGraph && !(selectionElementFunction.Element.Kind != AttributeType.Property))
{
switch (selectionElementFunction.Element.Kind)
{
case AttributeType.IncomingEdge:
#region incoming edge
var incomingEdgeDefinition = (IIncomingEdgeDefinition)selectionElementFunction.Element;
if (myDBObject.HasIncomingVertices(incomingEdgeDefinition.RelatedEdgeDefinition.RelatedType.ID, incomingEdgeDefinition.RelatedEdgeDefinition.ID))
{
callingObject = _ExpressionGraph.Select(
new LevelKey(
(myLevelKey + new EdgeKey(selectionElementFunction.Element.RelatedType.ID, selectionElementFunction.Element.ID)).Edges,
_graphdb, mySecurityToken, myTransactionToken), myDBObject, true);
}
else
{
callingObject = null;
}
#endregion
break;