public Expression GetResolvedOptionalElementSelector(ClauseGenerationContext clauseGenerationContext)
        {
            if (OptionalElementSelector == null)
            {
                return(null);
            }

            return(_cachedElementSelector.GetOrCreate(
                       r => r.GetResolvedExpression(OptionalElementSelector.Body, OptionalElementSelector.Parameters[0],
                                                    clauseGenerationContext)));
        }
 public Expression GetResolvedResultSelector(ClauseGenerationContext clauseGenerationContext)
 {
     return(_cachedResultSelector.GetOrCreate(
                r => r.GetResolvedExpression(
                    QuerySourceExpressionNodeUtility.ReplaceParameterWithReference(
                        this,
                        ResultSelector.Parameters[1],
                        ResultSelector.Body,
                        clauseGenerationContext),
                    ResultSelector.Parameters[0],
                    clauseGenerationContext)));
 }
Exemple #3
0
        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)));
        }
 public Expression GetResolvedKeySelector(ClauseGenerationContext clauseGenerationContext)
 {
     return(_cachedSelector.GetOrCreate(r =>
                                        r.GetResolvedExpression(KeySelector.Body, KeySelector.Parameters[0], clauseGenerationContext)));
 }
 public Expression GetResolvedPredicate(ClauseGenerationContext clauseGenerationContext)
 {
     return(_cachedPredicate.GetOrCreate(r =>
                                         r.GetResolvedExpression(Predicate.Body, Predicate.Parameters[0], clauseGenerationContext)));
 }