The Telerik Platform product is retired.Learn more

Deleting Data Items

Deleting Data Items

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

Similar to updating items, you can delete either by ID or by filter.

Deleting a Single Item by ID

To delete a single item, pass its ID to the Delete() method.

public async Task DeleteById(EverliveApp app, Guid id)
    await app.WorkWith().Data<Activity>().Delete(id).ExecuteAsync();

Deleting Multiple Items

Multiple items are typically deleted trough a filter but you can also omit it in which case you will be deleting all items in the specified content type.

Always double-check your filter expression and test it on a dummy copy of your data. This will help you avoid destroying the wrong items.

The following example deletes all items whose UserId field matches a given value.

public async Task DeleteMultiple(EverliveApp app, Guid userId)
    await app.WorkWith().Data<Activity>().Delete().Where(a => a.UserId == userId).ExecuteAsync();

See Also

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