Class SortExpressionComparer<T>
- Namespace
- DynamicData.Binding
- Assembly
- DynamicData.dll
Generic sort expression to help create inline sorting for the .Sort(IComparer comparer) operator.
public class SortExpressionComparer<T> : List<SortExpression<T>>, IList<SortExpression<T>>, ICollection<SortExpression<T>>, IList, ICollection, IReadOnlyList<SortExpression<T>>, IReadOnlyCollection<SortExpression<T>>, IEnumerable<SortExpression<T>>, IEnumerable, IComparer<T>
Type Parameters
T
The item to sort against.
- Inheritance
-
List<SortExpression<T>>SortExpressionComparer<T>
- Implements
-
IList<SortExpression<T>>IComparer<T>
- Inherited Members
- Extension Methods
Constructors
SortExpressionComparer()
public SortExpressionComparer()
Methods
Ascending(Func<T, IComparable>)
Create an ascending sort expression.
public static SortExpressionComparer<T> Ascending(Func<T, IComparable> expression)
Parameters
expression
Func<T, IComparable>The expression.
Returns
- SortExpressionComparer<T>
A comparer in ascending order.
Compare(T?, T?)
public int Compare(T? x, T? y)
Parameters
x
Ty
T
Returns
Descending(Func<T, IComparable>)
Create an descending sort expression.
public static SortExpressionComparer<T> Descending(Func<T, IComparable> expression)
Parameters
expression
Func<T, IComparable>The expression.
Returns
- SortExpressionComparer<T>
A comparer in descending order.
ThenByAscending(Func<T, IComparable>)
Adds an additional ascending sort expression.
public SortExpressionComparer<T> ThenByAscending(Func<T, IComparable> expression)
Parameters
expression
Func<T, IComparable>The expression.
Returns
- SortExpressionComparer<T>
A comparer in ascending order first taking into account the comparer passed in.
ThenByDescending(Func<T, IComparable>)
Adds an additional descending sort expression.
public SortExpressionComparer<T> ThenByDescending(Func<T, IComparable> expression)
Parameters
expression
Func<T, IComparable>The expression.
Returns
- SortExpressionComparer<T>
A comparer in descending order first taking into account the comparer passed in.