Class SortBuilder<T>
A utility for building sorting specifications for an operation.
public class SortBuilder<T>
Type Parameters
TThe type of the document
- Inheritance
-
SortBuilder<T>
- Derived
- Inherited Members
Methods
Ascending(string)
Adds an ascending sort.
public SortBuilder<T> Ascending(string fieldName)
Parameters
fieldNamestringThe name of the field to sort by.
Returns
- SortBuilder<T>
The sort builder.
Remarks
We recommend using the strongly-typed version Ascending<TField>(Expression<Func<T, TField>>) instead.
Ascending<TField>(Expression<Func<T, TField>>)
Adds an ascending sort.
public SortBuilder<T> Ascending<TField>(Expression<Func<T, TField>> expression)
Parameters
expressionExpression<Func<T, TField>>The expression representing the sort field.
Returns
- SortBuilder<T>
The sort builder.
Type Parameters
TFieldThe type of the field to sort by.
Descending(string)
Adds a descending sort.
public SortBuilder<T> Descending(string fieldName)
Parameters
fieldNamestringThe name of the field to sort by.
Returns
- SortBuilder<T>
The sort builder.
Remarks
We recommend using the strongly-typed version Descending<TField>(Expression<Func<T, TField>>) instead.
Descending<TField>(Expression<Func<T, TField>>)
Adds a descending sort.
public SortBuilder<T> Descending<TField>(Expression<Func<T, TField>> expression)
Parameters
expressionExpression<Func<T, TField>>The expression representing the sort field.
Returns
- SortBuilder<T>
The sort builder.
Type Parameters
TFieldThe type of the field to sort by.