Specifies a typed comparer to use for the ordering. A conversion to the
comparer type will be attempted for the object being compared. If the conversion fails
for either object, the default object comparer will be used. Note that this will also have the effect
of treating different convertible types as being of the same type. For example,
if you have two keys, 1 and "1", and use a string-based comparison, the
documents will compare as equal.
- Namespace
- Statiq.Core
- Containing Type
- OrderDocuments
Syntax
public OrderDocuments WithComparer<TValue>(IComparer<TValue> comparer)
Type Parameters
Parameters
Name |
Type |
Description |
comparer |
IComparer<TValue> |
The typed comparer to use. |
Return Value