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

Reading Data Items

Reading Data Items

The Backend Services .NET SDK allows you to read data items from existing content types programmatically.

Reading a Single Item by ID

To read an item, pass its ID to the GetById() method.

public async Task GetSingleItem(EverliveApp app, Guid activityId)
{
    var activity = await app.WorkWith().Data<Activity>().GetById(activityId).ExecuteAsync();
    Debug.WriteLine("Activity: " + activity.Text);
}

Reading Multiple Items

You can make a simple GetAll() call to get all items of a content type as the next example shows. To limit the results, use the Get() call instead and include a filtering or fields expression as described in Filtering and Getting a Subset of Fields. You can also modify the request to get sorted or paged results.

public async Task GetMultipleItems(EverliveApp app)
{
    var activities = await app.WorkWith().Data<Activity>().GetAll().ExecuteAsync();
    foreach(var activity in activities)
    {
        Debug.WriteLine("Activity: " + activity.Text);
    }
}

See Also

Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.