private static IOrderedAsyncEnumerable <TSource> ThenByShim <TSource, TKey>(
     IOrderedAsyncEnumerable <TSource> source, Func <TSource, TKey> expression, OrderingDirection orderingDirection)
 {
     return(orderingDirection == OrderingDirection.Asc
         ? source.ThenBy(expression)
         : source.ThenByDescending(expression));
 }
        public static IOrderedAsyncEnumerable <T> ThenBy <T>(this IOrderedAsyncEnumerable <T> source, string column,
                                                             SortDirection direction, IEnumerable <string>?extraAllowedColumns = null)
        {
            var lambda = CreatePropertySelector <T>(column, extraAllowedColumns);

            if (direction == SortDirection.Descending)
            {
                return(source.ThenByDescending(lambda));
            }

            return(source.ThenBy(lambda));
        }
Пример #3
0
        public static IOrderedAsyncEnumerable <TSource> ThenByDescending <TSource, TKey>(this IOrderedAsyncEnumerable <TSource> source, Func <TSource, TKey> keySelector)
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }
            if (keySelector == null)
            {
                throw new ArgumentNullException(nameof(keySelector));
            }

            return(source.ThenByDescending(keySelector, Comparer <TKey> .Default));
        }
 internal static IOrderedAsyncEnumerable <TSource> _ThenBy <TSource, TKey>(
     IOrderedAsyncEnumerable <TSource> source, Func <TSource, TKey> expression, OrderingDirection orderingDirection)
 => orderingDirection == OrderingDirection.Asc
         ? source.ThenBy(expression)
         : source.ThenByDescending(expression);