public static T MaxBy <T>(this IEnumerable <T> @this, IComparer <T> comparer = null) where T : class { if (comparer == null) { comparer = Comparer <T> .Default; } return(@this.MinBy(comparer.Revert())); }
public static ICollection <T> SortLast <T>(this IEnumerable <T> @this, int first, IComparer <T> comparer = null) { IComparer <T> IntComparer = comparer ?? Comparer <T> .Default; return(@this.SortFirst(first, IntComparer.Revert())); }