Ejemplo n.º 1
0
        public static IOrderedEnumerable <TSource> ThenByDescending <TSource, TKey>(this IOrderedEnumerable <TSource> source, Func <TSource, TKey> keySelector, IComparer <TKey> comparer)
        {
            LinqCheck.SourceAndKeySelector(source, keySelector);
            var oe = source as OrderedEnumerable <TSource>;

            if (oe != null)
            {
                return(oe.CreateOrderedEnumerable(keySelector, comparer, true));
            }
            return(source.CreateOrderedEnumerable(keySelector, comparer, true));
        }
Ejemplo n.º 2
0
 public static IOrderedEnumerable <TSource> OrderByDescending <TSource, TKey>(this IEnumerable <TSource> source, Func <TSource, TKey> keySelector, IComparer <TKey> comparer)
 {
     LinqCheck.SourceAndKeySelector(source, keySelector);
     return(new OrderedSequence <TSource, TKey>(source, keySelector, comparer, SortDirection.Descending));
 }