本文整理汇总了C#中IExpressionGraph.AddEmptyLevel方法的典型用法代码示例。如果您正苦于以下问题:C# IExpressionGraph.AddEmptyLevel方法的具体用法?C# IExpressionGraph.AddEmptyLevel怎么用?C# IExpressionGraph.AddEmptyLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IExpressionGraph
的用法示例。
在下文中一共展示了IExpressionGraph.AddEmptyLevel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExcludeFromGraph
/// <summary>
/// We need to add an empty level in case, the DBO should not be integerated. Otherwise the select does not know, either the level was never touched or
/// not added due to an expression
/// </summary>
/// <param name="myExpressionGraph"></param>
/// <param name="myLevelKey"></param>
private void ExcludeFromGraph(IExpressionGraph myExpressionGraph, LevelKey myLevelKey)
{
myExpressionGraph.AddEmptyLevel(myLevelKey);
}
示例2: MatchData
private static void MatchData(DataContainer data, IExpressionGraph resultGraph, IGraphDB myGraphDB, SecurityToken mySecurityToken, Int64 myTransactionToken, TypesOfOperators myTypeOfOperator, BinaryOperator myOperator)
{
#region data
LevelKey myLevelKey = CreateLevelKey(data.IDChainDefinitions.Item1, myGraphDB, mySecurityToken, myTransactionToken);
#endregion
var vertices = myGraphDB.GetVertices<List<IVertex>>(
mySecurityToken,
myTransactionToken,
new GraphDB.Request.RequestGetVertices(
new BinaryExpression(
new PropertyExpression(data.IDChainDefinitions.Item1.LastType.Name, data.IDChainDefinitions.Item1.LastAttribute.Name),
myOperator,
GenerateLiteral(data.Operands.Item1, ((IPropertyDefinition)data.IDChainDefinitions.Item1.LastAttribute).BaseType))),
(stats, vertexEnumerable) => vertexEnumerable.ToList());
foreach (var aVertex in vertices)
{
IntegrateInGraph(aVertex, resultGraph, myLevelKey, myTypeOfOperator);
}
if (resultGraph.ContainsLevelKey(myLevelKey))
{
#region clean lower levels
if (myTypeOfOperator == TypesOfOperators.AffectsLowerLevels)
{
CleanLowerLevel(myLevelKey, resultGraph, myGraphDB, mySecurityToken, myTransactionToken);
}
#endregion
}
else
{
resultGraph.AddEmptyLevel(myLevelKey);
}
}
示例3: ExcludeFromGraph
/// <summary>
/// We need to add an empty level in case, the DBO should not be integerated. Otherwise the select does not know, either the level was never touched or
/// not added due to an expression
/// </summary>
/// <param name="myDBObjectStream"></param>
/// <param name="myExpressionGraph"></param>
/// <param name="myLevelKey"></param>
/// <param name="myTypeManager"></param>
/// <param name="myQueryCache"></param>
private void ExcludeFromGraph(DBObjectStream myDBObjectStream, IExpressionGraph myExpressionGraph, LevelKey myLevelKey, DBContext myTypeManager, DBObjectCache myQueryCache)
{
myExpressionGraph.AddEmptyLevel(myLevelKey);
}
示例4: MatchData
/// <param name="data">The DataContainer.</param>
/// <param name="dbContext">The TypeManager of the database.</param>
/// <param name="queryCache">The current query cache.</param>
/// <param name="typeOfBinExpr">The type of the binary expression.</param>
/// <param name="idx">The index for the complex part.</param>
/// <param name="errors">A list of errors.</param>
/// <param name="resultGraph">The IExpressionGraph that serves as result.</param>
/// <returns>True if the method succeeded</returns>
private Exceptional<Boolean> MatchData(DataContainer data, DBContext dbContext, DBObjectCache dbObjectCache, TypesOfBinaryExpression typeOfBinExpr, IEnumerable<Tuple<GraphDBType, AAttributeIndex>> idx, IExpressionGraph resultGraph, SessionSettings mySessionToken)
{
#region data
LevelKey myLevelKey = CreateLevelKey(data.IDChainDefinitions.Item1, dbContext.DBTypeManager);
#endregion
foreach (var aIDX in idx)
{
//this is only for such type(DBVertex) that have no AAttributeIndex
if (aIDX.Item2 == null)
{
continue;
}
#region Execution
if (aIDX.Item2.IsUUIDIndex && (data.IDChainDefinitions.Item1.LastAttribute != dbContext.DBTypeManager.GetUUIDTypeAttribute()))
{
#region UUID idx - check ALL DBOs
var IndexRelatedType = dbContext.DBTypeManager.GetTypeByUUID(aIDX.Item2.IndexRelatedTypeUUID);
var idxKeyValues = (aIDX.Item2).GetAllValues(IndexRelatedType, dbContext);
if (idxKeyValues.CountIs(0))
{
continue;
}
var uuids = idxKeyValues.Aggregate((elem, aggrresult) => aggrresult.Union(elem));
var result = IntegrateUUID(data, dbContext, dbObjectCache, typeOfBinExpr, resultGraph, mySessionToken, myLevelKey, dbObjectCache.LoadListOfDBObjectStreams(aIDX.Item1, uuids));
if (result.Failed())
{
return new Exceptional<bool>(result);
}
if (resultGraph.ContainsLevelKey(myLevelKey))
{
#region clean lower levels
if (Type == TypesOfOperators.AffectsLowerLevels)
{
CleanLowerLevel(myLevelKey, dbContext, dbObjectCache, resultGraph);
}
#endregion
}
else
{
resultGraph.AddEmptyLevel(myLevelKey);
}
#endregion
}
else
{
#region Get operationValue and type
var operationValue = (AOperationDefinition)data.Operands.Item1;
#endregion
#region Attribute index
if (aIDX.Item2.IndexKeyDefinition.IndexKeyAttributeUUIDs.Count > 1)
{
return new Exceptional<bool>(new Error_NotImplemented(new System.Diagnostics.StackTrace(true), "Currently it is not implemented to use compound indices."));
}
var interestingUUIDsByIdx = IndexSingleOperation(aIDX.Item2, operationValue, data.IDChainDefinitions.Item1.LastAttribute.UUID, typeOfBinExpr, dbContext);
#region integrate in graph
var runMT = DBConstants.RunMT;
if (runMT)
{
Parallel.ForEach(dbObjectCache.LoadListOfDBObjectStreams(data.IDChainDefinitions.Item1.LastType, interestingUUIDsByIdx), aDBO =>
{
IntegrateInGraph(aDBO.Value, resultGraph, myLevelKey, dbContext, dbObjectCache);
}
);
}
else
{
foreach (var aDBO in dbObjectCache.LoadListOfDBObjectStreams(data.IDChainDefinitions.Item1.LastType, interestingUUIDsByIdx))
{
//.........这里部分代码省略.........
示例5: UpgradeGraphStructure
private void UpgradeGraphStructure(IExpressionGraph aGraph, Dictionary<int, HashSet<LevelKey>> difference)
{
foreach (var aDiffLevel in difference)
{
foreach (var aLevelKey in aDiffLevel.Value)
{
aGraph.AddEmptyLevel(aLevelKey);
}
}
}
示例6: MergeGraphs
private void MergeGraphs(IExpressionGraph destinationGraph, int maxDestLevel, IExpressionGraph sourceGraph, int maxSourceLevel)
{
#region merge up to the limit of the sourceGraph
foreach (var aLevel in sourceGraph.Levels.OrderBy(item => item.Key))
{
foreach (var aLevelPayload in aLevel.Value.ExpressionLevels)
{
//create empty level
destinationGraph.AddEmptyLevel(aLevelPayload.Key);
foreach (var aNode in aLevelPayload.Value.Nodes)
{
MergeNodeIntoGraph(destinationGraph, aLevelPayload.Key, aNode.Value, sourceGraph);
}
}
}
#endregion
}