/// <summary> /// Performs a subsequent ordering of the elements of a sequence in parallel and in descending order according to a key. /// </summary> /// <typeparam name="TSource">The type of the elements of source.</typeparam> /// <typeparam name="TKey">The type of the key returned by keySelector.</typeparam> /// <param name="query">A query whose values to order.</param> /// <param name="keySelector">A function to extract a key from an element.</param> /// <returns>A parallel query whose elements are sorted according to a key.</returns> public static IParallelQueryExpr <IOrderedEnumerable <TSource> > ThenByDescending <TSource, TKey>(this IParallelQueryExpr <IOrderedEnumerable <TSource> > query, Expression <Func <TSource, TKey> > keySelector) { return(new ParallelQueryExpr <IOrderedEnumerable <TSource> >(QExpr.AddOrderBy(keySelector, Order.Descending, query.Expr))); }
/// <summary> /// Creates a query that sorts the elements of a sequence in ascending order according to a key. /// </summary> /// <typeparam name="TSource">The type of the elements of source.</typeparam> /// <typeparam name="TKey">The type of the key returned by keySelector.</typeparam> /// <param name="query">A query whose values to order.</param> /// <param name="keySelector">A function to extract a key from an element.</param> /// <returns>A query whose elements are sorted according to a key.</returns> public static IQueryExpr <IOrderedEnumerable <TSource> > OrderBy <TSource, TKey>(this IQueryExpr <IEnumerable <TSource> > query, Expression <Func <TSource, TKey> > keySelector) { return(new QueryExpr <IOrderedEnumerable <TSource> >(QExpr.AddOrderBy(keySelector, Order.Ascending, query.Expr))); }