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


ThenBy<T, TValue>(IComparer<T>?, Func<T, TValue>, IComparer<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 provided comparer or the default comparer for the return type of the selector if no comparer is specified.
Containing Type


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

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.
comparer IComparer<TValue> The comparer to use when comparing the values returned by the selector.

Return Value

Type Description
IComparer<T> A comparer.