[]
        
(Showing Draft Content)

C1.DataCollection.IDataCollectionEx.SortAsync

SortAsync Method

SortAsync<T>(IDataCollection<T>, string, SortDirection)

Sorts the data collection according to the specified sort parameters.

Declaration
public static Task SortAsync<T>(this IDataCollection<T> dataCollection, string sortPath, SortDirection sortDirection = SortDirection.Ascending) where T : class?
Parameters
Type Name Description
IDataCollection<T> dataCollection

The data collection.

string sortPath

The path of the data item to which the sort description will be applied.

SortDirection sortDirection

The direction of the sort operation.

Returns
Type Description
Task
Type Parameters
Name Description
T

SortAsync<T>(IDataCollection<T>, Expression<Func<T, object>>, SortDirection)

Sorts the data collection according to the specified sort path and direction.

Declaration
public static Task SortAsync<T>(this IDataCollection<T> dataCollection, Expression<Func<T, object>> sortPath, SortDirection sortDirection = SortDirection.Ascending) where T : class?
Parameters
Type Name Description
IDataCollection<T> dataCollection

The data collection.

Expression<Func<T, object>> sortPath

The filter path.

SortDirection sortDirection

The sort direction.

Returns
Type Description
Task
Type Parameters
Name Description
T

SortAsync<T>(IDataCollection<T>, params SortDescription[])

Sorts the data collection according to the specified sort descriptions.

Declaration
public static Task SortAsync<T>(this IDataCollection<T> dataCollection, params SortDescription[] sortDescriptions) where T : class?
Parameters
Type Name Description
IDataCollection<T> dataCollection

The data collection.

SortDescription[] sortDescriptions

The sort descriptions that determine how the data will be sort.

Returns
Type Description
Task
Type Parameters
Name Description
T

SortAsync<T>(IDataCollection<T>, SortDescription[], CancellationToken)

Sorts the data collection according to the specified sort descriptions.

Declaration
public static Task SortAsync<T>(this IDataCollection<T> dataCollection, SortDescription[] sortDescriptions, CancellationToken cancellationToken = default) where T : class?
Parameters
Type Name Description
IDataCollection<T> dataCollection

The data collection.

SortDescription[] sortDescriptions

The sort descriptions that determine how the data will be sort.

CancellationToken cancellationToken

The cancellation token.

Returns
Type Description
Task
Type Parameters
Name Description
T