Class ComparerFactory<T>
- Namespace
- LfrlAnvil
- Assembly
- LfrlAnvil.Core.dll
Creates instances of IComparer<T> type.
public static class ComparerFactory<T>
Type Parameters
T
Value type.
- Inheritance
-
ComparerFactory<T>
- Inherited Members
Methods
CreateBy<TValue>(Func<T?, TValue?>)
Creates a new IComparer<T> instance that compares values
by comparing results of the provided selector
using the Default comparer.
[Pure]
public static IComparer<T> CreateBy<TValue>(Func<T?, TValue?> selector)
Parameters
selector
Func<T, TValue>Comparable value selector.
Returns
- IComparer<T>
New IComparer<T> instance.
Type Parameters
TValue
Comparable value type.
CreateBy<TValue>(Func<T?, TValue?>, IComparer<TValue>)
Creates a new IComparer<T> instance that compares values
by comparing results of the provided selector
.
[Pure]
public static IComparer<T> CreateBy<TValue>(Func<T?, TValue?> selector, IComparer<TValue> valueComparer)
Parameters
Returns
- IComparer<T>
New IComparer<T> instance.
Type Parameters
TValue
Comparable value type.