protected override ResultOperatorBase CreateResultOperator(ClauseGenerationContext clauseGenerationContext)
        {
            var resultOperator = new UnionResultOperator(AssociatedIdentifier, ItemType, Source2);

            clauseGenerationContext.AddContextInfo(this, resultOperator);
            return(resultOperator);
        }
        private MainFromClause CreateMainFromClause(ClauseGenerationContext clauseGenerationContext)
        {
            var fromClause = new MainFromClause(
                AssociatedIdentifier,
                QuerySourceElementType,
                ParsedExpression);

            clauseGenerationContext.AddContextInfo(this, fromClause);
            return(fromClause);
        }
Esempio n. 3
0
        public JoinClause CreateJoinClause(ClauseGenerationContext clauseGenerationContext)
        {
            var dummyInnerKeySelector = Expression.Constant(null);
            var joinClause            = new JoinClause(
                ResultSelector.Parameters[1].Name,
                ResultSelector.Parameters[1].Type,
                InnerSequence,
                GetResolvedOuterKeySelector(clauseGenerationContext),
                dummyInnerKeySelector);

            clauseGenerationContext.AddContextInfo(this, joinClause);

            joinClause.InnerKeySelector = GetResolvedInnerKeySelector(clauseGenerationContext);
            return(joinClause);
        }
        protected override QueryModel ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
        {
            ArgumentUtility.CheckNotNull("queryModel", queryModel);

            var joinClause      = JoinExpressionNode.CreateJoinClause(clauseGenerationContext);
            var groupJoinClause = new GroupJoinClause(ResultSelector.Parameters[1].Name, ResultSelector.Parameters[1].Type, joinClause);

            clauseGenerationContext.AddContextInfo(this, groupJoinClause);
            queryModel.BodyClauses.Add(groupJoinClause);

            var selectClause = queryModel.SelectClause;

            selectClause.Selector = GetResolvedResultSelector(clauseGenerationContext);

            return(queryModel);
        }
        protected override QueryModel ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
        {
            ArgumentUtility.CheckNotNull("queryModel", queryModel);

            var resolvedCollectionSelector = GetResolvedCollectionSelector(clauseGenerationContext);
            var clause = new AdditionalFromClause(ResultSelector.Parameters[1].Name, ResultSelector.Parameters[1].Type, resolvedCollectionSelector);

            queryModel.BodyClauses.Add(clause);

            clauseGenerationContext.AddContextInfo(this, clause);

            var selectClause = queryModel.SelectClause;

            selectClause.Selector = GetResolvedResultSelector(clauseGenerationContext);

            return(queryModel);
        }
Esempio n. 6
0
        protected override ResultOperatorBase CreateResultOperator(ClauseGenerationContext clauseGenerationContext)
        {
            var resolvedKeySelector = GetResolvedKeySelector(clauseGenerationContext);

            var resolvedElementSelector = GetResolvedOptionalElementSelector(clauseGenerationContext);

            if (resolvedElementSelector == null)
            {
                // supply a default element selector if none is given
                // just resolve KeySelector.Parameters[0], that's the input data flowing in from the source node
                resolvedElementSelector = Source.Resolve(KeySelector.Parameters[0], KeySelector.Parameters[0], clauseGenerationContext);
            }

            var resultOperator = new GroupResultOperator(AssociatedIdentifier, resolvedKeySelector, resolvedElementSelector);

            clauseGenerationContext.AddContextInfo(this, resultOperator);
            return(resultOperator);
        }