The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.


ThenBy<T, TValue>(IComparer<T>?, Func<T, TValue>) Method


Creates a derived comparer based on the given parent comparer. The returned comparer will sort elements using the parent comparer first. If the parent considers the values equal elements will be sorted in ascending order based on the values returned by the provided selector. The selector values will be compared using the default comparer for the return type of the selector.
Containing Type


public static IComparer<T> ThenBy<T, TValue>(this IComparer<T>? parent, Func<T, TValue> selector)

Type Parameters

Name Description
T The comparison type.
TValue The value type.


Name Type Description
parent IComparer<T>? The parent comparer to use first.
selector Func<T, TValue> A function supplying the values for the comparer.

Return Value

Type Description
IComparer<T> A comparer.