Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Sorting

Sorting

Telerik Platform can return query results in sorted order: ascending or descending. All processing is performed on the server, saving you the additional operations on the client.

Ascending

You can retrieve items sorted in ascending order by a field by executing the following code snippet:

public async Task GetActivities(EverliveApp app)
{
    SortingDefinition sortAsc = new SortingDefinition("CreatedAt", Telerik.Everlive.Sdk.Core.Linq.Translators.OrderByDirection.Ascending);
    var activities = await this.App.WorkWith().Data<Activity>().Get().SetSorting(sortAsc).ExecuteSync();
}

Descending

You can read items sorted in descending order by a field by executing the following code snippet:

public async Task GetActivities(EverliveApp app)
{
    string activitiesTypeName = "Activities";
    EverliveQueryable activities = app.Items(activitiesTypeName).Get();

    var resultActivities = activities.OrderByDescending(a => a.CreatedAt);
    SortingDefinition sortDesc = new SortingDefinition("CreatedAt", Telerik.Everlive.Sdk.Core.Linq.Translators.OrderByDirection.Descending);

    var activities = this.App.WorkWith().Data<Activity>().Get().SetSorting(sortDesc).ExecuteSync();
}
Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.