public override Expression Resolve(ParameterExpression inputParameter, Expression expressionToBeResolved, ClauseGenerationContext clauseGenerationContext)
        {
            ArgumentUtility.CheckNotNull("inputParameter", inputParameter);
            ArgumentUtility.CheckNotNull("expressionToBeResolved", expressionToBeResolved);

            // UnionResultOperator is a query source, so expressions reolve their input parameter with the UnionResultOperator created by this node.
            return(QuerySourceExpressionNodeUtility.ReplaceParameterWithReference(this, inputParameter, expressionToBeResolved, clauseGenerationContext));
        }
Esempio n. 2
0
 public override Expression Resolve(
     ParameterExpression inputParameter, Expression expressionToBeResolved, ClauseGenerationContext clauseGenerationContext)
 {
     return(QuerySourceExpressionNodeUtility.ReplaceParameterWithReference(
                this,
                inputParameter,
                expressionToBeResolved,
                clauseGenerationContext));
 }
        public Expression Resolve(ParameterExpression inputParameter, Expression expressionToBeResolved, ClauseGenerationContext clauseGenerationContext)
        {
            ArgumentUtility.CheckNotNull("inputParameter", inputParameter);
            ArgumentUtility.CheckNotNull("expressionToBeResolved", expressionToBeResolved);

            // query sources resolve into references that point back to the respective clauses
            return(QuerySourceExpressionNodeUtility.ReplaceParameterWithReference(
                       this,
                       inputParameter,
                       expressionToBeResolved,
                       clauseGenerationContext));
        }
        public Expression GetResolvedResultSelector(ClauseGenerationContext clauseGenerationContext)
        {
            // our result selector usually looks like this: (i, j) => new { i = i, j = j }
            // with the data for i coming from the previous node and j identifying the data from this node

            // we resolve the selector by first substituting j by a QuerySourceReferenceExpression pointing back to us, before asking the previous node
            // to resolve i

            return(_cachedResultSelector.GetOrCreate(
                       r => r.GetResolvedExpression(
                           QuerySourceExpressionNodeUtility.ReplaceParameterWithReference(this, ResultSelector.Parameters[1], ResultSelector.Body, clauseGenerationContext),
                           ResultSelector.Parameters[0],
                           clauseGenerationContext)));
        }
Esempio n. 5
0
 public Expression GetResolvedResultSelector(ClauseGenerationContext clauseGenerationContext)
 {
     return(_cachedResultSelector.GetOrCreate(r => r.GetResolvedExpression(
                                                  QuerySourceExpressionNodeUtility.ReplaceParameterWithReference(this, ResultSelector.Parameters[1], ResultSelector.Body, clauseGenerationContext),
                                                  ResultSelector.Parameters[0], clauseGenerationContext)));
 }