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)));
 }
        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)));
        }
예제 #4
0
 public LambdaExpression GetResolvedFunc(ClauseGenerationContext clauseGenerationContext)
 {
     // '(total, current) => total + current' becomes 'total => total + [current]'
     return(_cachedFunc.GetOrCreate(
                r => Expression.Lambda(r.GetResolvedExpression(Func.Body, Func.Parameters[1], clauseGenerationContext), Func.Parameters[0])));
 }
예제 #5
0
 public Expression GetResolvedPredicate(ClauseGenerationContext clauseGenerationContext)
 {
     return(_cachedPredicate.GetOrCreate(r => r.GetResolvedExpression(Predicate.Body, Predicate.Parameters[0], clauseGenerationContext)));
 }
예제 #6
0
 public Expression GetResolvedOuterKeySelector(ClauseGenerationContext clauseGenerationContext)
 {
     return(_cachedOuterKeySelector.GetOrCreate(
                r => r.GetResolvedExpression(OuterKeySelector.Body, OuterKeySelector.Parameters[0], clauseGenerationContext)));
 }