// <summary> // Apply the rules that belong to the specified rules table to the given query tree. // </summary> // <param name="projectionPruningRequired"> is projection pruning required after the rule application </param> // <returns> Whether any rule has been applied after which reapplying nullability rules may be useful </returns> private static bool Process( PlanCompiler compilerState, ReadOnlyCollection <ReadOnlyCollection <Rule> > rulesTable, out bool projectionPruningRequired) { var ruleProcessor = new RuleProcessor(); var context = new TransformationRulesContext(compilerState); compilerState.Command.Root = ruleProcessor.ApplyRulesToSubtree(context, rulesTable, compilerState.Command.Root); projectionPruningRequired = context.ProjectionPrunningRequired; return(context.ReapplyNullabilityRules); }
private static bool Process( System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler compilerState, ReadOnlyCollection <ReadOnlyCollection <System.Data.Entity.Core.Query.InternalTrees.Rule> > rulesTable, out bool projectionPruningRequired) { RuleProcessor ruleProcessor = new RuleProcessor(); TransformationRulesContext transformationRulesContext = new TransformationRulesContext(compilerState); compilerState.Command.Root = ruleProcessor.ApplyRulesToSubtree((RuleProcessingContext)transformationRulesContext, rulesTable, compilerState.Command.Root); projectionPruningRequired = transformationRulesContext.ProjectionPrunningRequired; return(transformationRulesContext.ReapplyNullabilityRules); }