Table of Contents

Method ThenBy

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

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

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

public static IOrderedMongoQueryable<TSource> ThenBy<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 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.