Ejemplo n.º 1
0
    public override bool TryActivate(IQueryPlanState state)
    {
        IVariableValueCollection variables = state.Context.Variables;

        foreach (ISelection?selection in _selections)
        {
            if (state.Selections.Contains(selection.Id) && selection.IsIncluded(variables))
            {
                return(true);
            }
        }

        return(false);
    }
Ejemplo n.º 2
0
    public override void CompleteTask(IQueryPlanState state, IExecutionTask task)
    {
        Debug.Assert(ReferenceEquals(task.State, this), "The task must be part of this step.");

        if (task is ResolverTask {
            ChildTasks : { Count : > 0 }
        } resolverTask)
        {
            foreach (ResolverTask?childTask in resolverTask.ChildTasks)
            {
                state.Selections.Add(childTask.Selection.Id);
            }

            state.RegisterUnsafe(resolverTask.ChildTasks);
        }
    }
Ejemplo n.º 3
0
 /// <summary>
 /// Completes a task that was spawned from this execution step.
 /// </summary>
 /// <param name="state">
 /// The current query plan execution state.
 /// </param>
 /// <param name="task">
 /// The execution task that was spawned from the execution task.
 /// </param>
 public virtual void CompleteTask(IQueryPlanState state, IExecutionTask task)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Tries to activate this execution step for the current request.
 /// If the activation returns <c>false</c> and it is
 /// not part of the current request and can be skipped.
 /// </summary>
 /// <param name="state">
 /// The current query plan execution state.
 /// </param>
 /// <returns>
 /// Returns <c>true</c> if this step is part of the current request;
 /// otherwise, <c>false</c>.
 /// </returns>
 public virtual bool TryActivate(IQueryPlanState state) => true;