Skip to content

Deleting Entities in Relewise

The examples below are using our .NET/C# SDK, which is available via NuGet.

As a rule, Relewise recommends disabling entities instead of deleting them. If, however, you need to fully delete entities from Relewise, this is how you do it:


Start by making a ITracker-instance.

csharp
ITracker tracker = new Tracker(new Guid("00000000-0000-0000-0000-000000000001"), "your api key", "server-url");

Read more about how to authenticate against our API here.

Delete All Products from Relewise

This will remove all Products from Relewise, including any saved product relations and tracked behavioral data. Once again, we recommend disabling products rather than deleting them.

csharp
tracker.Track(new ProductAdministrativeAction(null, null, new FilterCollection(new Filter[] 
	{
		new ProductDataFilter("non-existing-key", new EqualsCondition(10D, true), false)
	}), ProductAdministrativeAction.UpdateKind.Delete));

This code essentially deletes all products that do not have the non-existing-key with value 10D - which should be all of them.

Deleting Entities is Permanent

Deleting entities from Relewise is Permanent and does not come with an undo button. Pursue this course at your own risk, or reach out to us for help if you are unsure if what you are doing is the right thing.

Deleting entities also completely removes any tracked product relations and behavioral data. This is irreversible.

Delete a Specific Product from Relewise:

csharp
tracker.Track(new ProductAdministrativeAction(null, null, new FilterCollection(new Filter[] 
	{
		new ProductIdFilter("ProductId")
	}), ProductAdministrativeAction.UpdateKind.Delete));

This will remove the specific product from Relewise. This process is irreversible and permanent.

Delete All Content from Relewise

This will remove all Content from Relewise, including any saved ccontent relations and tracked behavioral data. Once again, we recommend disabling products rather than deleting them.

csharp
tracker.Track(new ContentAdministrativeAction(null, null, new FilterCollection(new Filter[] 
	{
		new ContentDataFilter("non-existing-key", new EqualsCondition(10D, true), false)
	}), ContentAdministrativeAction.UpdateKind.Delete));

This code essentially deletes all content that do not have the non-existing-key with value 10D - which should be all of them.

Deleting Entities is Permanent

Deleting entities from Relewise is Permanent and does not come with an undo button. Pursue this course at your own risk, or reach out to us for help if you are unsure if what you are doing is the right thing.

Deleting entities also completely removes any tracked content relations and behavioral data. This is irreversible.

Delete a Specific content from Relewise:

csharp
tracker.Track(new ContentAdministrativeAction(null, null, new FilterCollection(new Filter[] 
	{
		new ContentIdFilter("contentId")
	}), ContentAdministrativeAction.UpdateKind.Delete));

This will remove the specific content from Relewise. This process is irreversible and permanent.

Don't know us? Don't worry - you can find more information about us, by visiting our main page www.relewise.com