private Expression GetNewSelectExpressionWithOrderings (SqlStatement sqlStatement)
{
// wrap original select projection and all orderings into a large tuple expression (new { proj, new { o1, new { o2, ... }}})
var expressionsToBeTupelized = new[] { sqlStatement.SelectProjection }.Concat (sqlStatement.Orderings.Select (o => o.Expression));
var tupleExpression = TupleExpressionBuilder.AggregateExpressionsIntoTuple (expressionsToBeTupelized);
var preparedTupleExpression = _stage.PrepareSelectExpression (tupleExpression, _context);
if (preparedTupleExpression.Type != tupleExpression.Type)
throw new InvalidOperationException ("The SQL Preparation stage must not change the type of the select projection.");
return preparedTupleExpression;
}