Table of Contents

Method ThenByDescending

Namespace
MongoDB.Driver.Linq
Assembly
MongoDB.Driver.dll

ThenByDescending<TSource, TKey>(IOrderedMongoQueryable<TSource>, Expression<Func<TSource, TKey>>)

Performs a subsequent ordering of the elements in a sequence in descending order according to a key.

public static IOrderedMongoQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedMongoQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector)

Parameters

source IOrderedMongoQueryable<TSource>

A sequence of values to order.

keySelector Expression<Func<TSource, TKey>>

A function to extract a key from an element.

Returns

IOrderedMongoQueryable<TSource>

An IOrderedMongoQueryable<T> whose elements are sorted in descending order according to a key.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by the function that is represented by keySelector.