#pragma warning restore 649 /// <summary> /// Process a result operator. If this result is amenable to be made into a function, then /// do so. /// </summary> /// <param name="resultOperator"></param> /// <param name="queryModel"></param> /// <param name="index"></param> public override void VisitResultOperator(ResultOperatorBase resultOperator, QueryModel queryModel, int index) { // Look for a single-result processor var processor = _operators.FindScalarROProcessor(resultOperator.GetType()); if (processor != null) { var result = processor.ProcessResultOperator(resultOperator, queryModel, _codeEnv, _codeContext, MEFContainer); if (result != null) { _codeEnv.SetResult(result); _scoping.Add(_codeContext.Add(queryModel, result)); } return; } // Look for a sequence processor var collectionProcessor = _operators.FindCollectionROProcessor(resultOperator.GetType()); if (collectionProcessor != null) { collectionProcessor.ProcessResultOperator(resultOperator, queryModel, _codeEnv, _codeContext, MEFContainer); _codeEnv.ResetResult(); return; } /// /// Uh oh - no idea how to do this! /// throw new InvalidOperationException("LINQToTTree can't translate the operator '" + resultOperator.ToString() + "'"); }