Exemple #1
0
        protected override void ApplyNodeSpecificSemantics(QueryModel queryModel,
                                                           ClauseGenerationContext clauseGenerationContext)
        {
            LinqUtility.CheckNotNull("queryModel", queryModel);

            if (IsLetNode)
            {
                // For let nodes, we insert a LetClause instance, then adapt the SelectClause to select the data bubbling out of the LetClause.
                var resolvedLetExpression = GetResolvedLetExpression(clauseGenerationContext);
                var letClause             = new LetClause(_letConstruction.Constructor.GetParameters()[1].Name,
                                                          resolvedLetExpression);
                queryModel.BodyClauses.Add(letClause);

                clauseGenerationContext.AddContextInfo(this, letClause);

                queryModel.SelectClause.Selector = GetResolvedAdaptedSelector(clauseGenerationContext);
            }
            else
            {
                base.ApplyNodeSpecificSemantics(queryModel, clauseGenerationContext);
            }
        }
Exemple #2
0
        protected override void ApplyNodeSpecificSemantics(QueryModel queryModel,
                                                           ClauseGenerationContext clauseGenerationContext)
        {
            Utils.CheckNotNull("queryModel", queryModel);

            var resolvedCollectionSelector = GetResolvedCollectionSelector(clauseGenerationContext);
            var resolvedLetSelector        = GetResolvedLetSelector(clauseGenerationContext);

            var clause = new LetClause(CollectionSelector.Parameters[1].Name, resolvedLetSelector,
                                       resolvedCollectionSelector);

            queryModel.BodyClauses.Add(clause);

            //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 =
                //GetResolvedCollectionSelector(clauseGenerationContext);
                GetResolvedResultSelector(clauseGenerationContext);
        }