// Utility translator method for lambda expressions that are part of group by. Given a lambda expression and its translated // inputs, translates the lambda expression, assuming the input needs to be used as a grouping input private DbExpression TranslateLambda(LambdaExpression lambda, DbExpression input, out DbGroupExpressionBinding binding) { input = NormalizeSetSource(input); // create binding context for this lambda expression var alias = _aliasGenerator.Next(); binding = input.GroupBindAs(alias, string.Format(CultureInfo.InvariantCulture, "Group{0}", alias)); return TranslateLambda(lambda, binding.Variable); }