Click or drag to resize

XComparer Class

Provides extension and helper methods to create, combine and work with comparers.
Inheritance Hierarchy
SystemObject
  Linq.ExtrasXComparer

Namespace:  Linq.Extras
Assembly:  Linq.Extras (in Linq.Extras.dll) Version: 5.0.0+96a4f4bfed64095342c5df107c1fe1fb95603ee5
Syntax
public static class XComparer

The XComparer type exposes the following members.

Methods
  NameDescription
Public methodStatic memberByT, TKey
Creates a comparer with ascending order based on the specified comparison key and key comparer.
Public methodStatic memberByDescendingT, TKey
Creates a comparer with descending order based on the specified comparison key and key comparer.
Public methodStatic memberChainWithT
Chains two comparers. The resulting comparer will first compare items using comparer, and if it's not enough to decide which is greater, it will use nextComparer to decide.
Public methodStatic memberFromComparisonT
Public methodStatic memberMaxT
Returns the greater of two items according to comparer.
Public methodStatic memberMinT
Returns the lesser of two items according to comparer.
Public methodStatic memberReverseT
Returns a comparer that has the reverse logic of the original comparer.
Public methodStatic memberThenByT, TKey
Chains a secondary comparer with ascending order based on the specified key to an existing comparer.
Public methodStatic memberThenByDescendingT, TKey
Chains a secondary comparer with descending order based on the specified key to an existing comparer.
Top
See Also