Computer Magic Logo
Delete value

Monday, March 14, 2016

Published by Aristotelis Pitaridis

In order to delete a value we use the Delete static member function of the Settings class. The first parameter is the Application name and the second parameter is the Setting name.

@using CMUmbracoTools.Data
@{ 
    Settings.Delete("MyApplicationName", "Username");
}

If we want to delete all the settings for a specific application we can use the DeleteAllApplicationSettings static member function of the Settings class. The parameter of the member function is the Application name.

@using CMUmbracoTools.Data
@{ 
    Settings.DeleteAllApplicationSettings("MyApplicationName");
}

If we want to delete all the settings for all applications we can use the DeleteAllSettings member function.

@using CMUmbracoTools.Data
@{ 
    Settings.DeleteAllSettings();
}