Table of Contents

Class SortBuilder<T>

Namespace
DataStax.AstraDB.DataApi.Core.Query
Assembly
DataStax.AstraDB.DataApi.dll

A utility for building sorting specifications for an operation.

public class SortBuilder<T>

Type Parameters

T

The type of the document

Inheritance
SortBuilder<T>
Derived
Inherited Members

Methods

Ascending(string)

Adds an ascending sort.

public SortBuilder<T> Ascending(string fieldName)

Parameters

fieldName string

The 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

expression Expression<Func<T, TField>>

The expression representing the sort field.

Returns

SortBuilder<T>

The sort builder.

Type Parameters

TField

The type of the field to sort by.

Descending(string)

Adds a descending sort.

public SortBuilder<T> Descending(string fieldName)

Parameters

fieldName string

The 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

expression Expression<Func<T, TField>>

The expression representing the sort field.

Returns

SortBuilder<T>

The sort builder.

Type Parameters

TField

The type of the field to sort by.