using System; using System.Collections.Generic; using System.Text; namespace System.Linq { public static partial class Enumerable { // OrderBy: public static IOrderedEnumerable OrderBy ( this IEnumerable source, Func keySelector) { return OrderBy (source, keySelector, null); } public static IOrderedEnumerable OrderBy ( this IEnumerable source, Func keySelector, IComparer comparer) { return new OrderByEnumerable (source, keySelector, null, false); } public static IOrderedEnumerable OrderByDescending ( this IEnumerable source, Func keySelector) { return OrderByDescending (source, keySelector, null); } public static IOrderedEnumerable OrderByDescending ( this IEnumerable source, Func keySelector, IComparer comparer) { return new OrderByEnumerable (source, keySelector, null, true); } // ThenBy: public static IOrderedEnumerable ThenBy ( this IOrderedEnumerable source, Func keySelector) { return ThenBy (source, keySelector, null); } public static IOrderedEnumerable ThenBy ( this IOrderedEnumerable source, Func keySelector, IComparer comparer) { return source.CreateOrderedEnumerable (keySelector, comparer, false); } public static IOrderedEnumerable ThenByDescending ( this IOrderedEnumerable source, Func keySelector) { return ThenByDescending (source, keySelector, null); } public static IOrderedEnumerable ThenByDescending ( this IOrderedEnumerable source, Func keySelector, IComparer comparer) { return source.CreateOrderedEnumerable (keySelector, comparer, true); } } }