using System; using System.Collections.Generic; using System.Text; namespace System.Linq { public static partial class Enumerable { public static IEnumerable> GroupBy ( this IEnumerable source, Func keySelector) { return source.GroupBy (keySelector, x => x, null); } public static IEnumerable> GroupBy ( this IEnumerable source, Func keySelector, IEqualityComparer comparer) { return source.GroupBy (keySelector, x => x, comparer); } public static IEnumerable> GroupBy ( this IEnumerable source, Func keySelector, Func elementSelector) { return source.GroupBy (keySelector, elementSelector, null); } public static IEnumerable> GroupBy ( this IEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) { return Lookup.Create (source, keySelector, elementSelector, comparer); } } }