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);
        }
        protected override QueryModel ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
        {
            Utils.CheckNotNull("queryModel", queryModel);

            var groupByClause = new GroupByClause(GetResolvedSelector(clauseGenerationContext),Selector,intoIdentifier);
            queryModel.BodyClauses.Add(groupByClause);

            clauseGenerationContext.AddContextInfo(this, groupByClause);

            queryModel.SelectClause.Selector = GetResolvedAdaptedSelector(clauseGenerationContext);


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

      var previousFetchRequest = clauseGenerationContext.GetContextInfo (Source) as FetchRequestBase;
      if (previousFetchRequest == null)
        throw new NotSupportedException ("ThenFetchMany must directly follow another Fetch request.");

      var innerFetchRequest = CreateFetchRequest();
      innerFetchRequest = previousFetchRequest.GetOrAddInnerFetchRequest (innerFetchRequest);
      // Store a mapping between this node and the innerFetchRequest so that a later ThenFetch... node may add its request to the innerFetchRequest.
      clauseGenerationContext.AddContextInfo (this, innerFetchRequest);

      return queryModel;
    }
        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);
        }
Example #8
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);
        }
    private MainFromClause CreateMainFromClause (ClauseGenerationContext clauseGenerationContext)
    {
      var fromClause = new MainFromClause (
          AssociatedIdentifier,
          QuerySourceElementType,
          ParsedExpression);

      clauseGenerationContext.AddContextInfo (this, fromClause);
      return fromClause;
    }
    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;
    }
        protected override QueryModel ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
        {
            Utils.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);
                return queryModel;
            }

            return base.ApplyNodeSpecificSemantics(queryModel, clauseGenerationContext);
        }
    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;
    }
    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 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;
    }
 protected override ResultOperatorBase CreateResultOperator (ClauseGenerationContext clauseGenerationContext)
 {
   var resultOperator = new UnionResultOperator (AssociatedIdentifier, ItemType, Source2);
   clauseGenerationContext.AddContextInfo (this, resultOperator);
   return resultOperator;
 }