internal GroupByWithResultSelectorExpressionNode(
            MethodCallExpressionParseInfo parseInfo,
            LambdaExpression keySelector,
            LambdaExpression elementSelectorOrResultSelector,
            LambdaExpression resultSelectorOrNull)
        {
            ArgumentUtility.CheckNotNull("keySelector", keySelector);
            ArgumentUtility.CheckNotNull("elementSelectorOrResultSelector", elementSelectorOrResultSelector);

            _selectExpressionNode = new SelectExpressionNode(
                CreateParseInfoWithGroupNode(parseInfo, keySelector, elementSelectorOrResultSelector,
                                             resultSelectorOrNull),
                CreateSelectorForSelectNode(keySelector, elementSelectorOrResultSelector, resultSelectorOrNull));
        }
        private static MethodCallExpressionParseInfo TransformParseInfo(
            MethodCallExpressionParseInfo parseInfo,
            LambdaExpression optionalPredicate,
            LambdaExpression optionalSelector)
        {
            var source = parseInfo.Source;

            if (optionalPredicate != null)
            {
                source = new WhereExpressionNode(parseInfo, optionalPredicate);
            }

            if (optionalSelector != null)
            {
                var newParseInfo = new MethodCallExpressionParseInfo(parseInfo.AssociatedIdentifier, source,
                                                                     parseInfo.ParsedExpression);
                source = new SelectExpressionNode(newParseInfo, optionalSelector);
            }

            return(new MethodCallExpressionParseInfo(parseInfo.AssociatedIdentifier, source,
                                                     parseInfo.ParsedExpression));
        }