Interface IConfigManipulator
Defines the contract for persisting configuration values back to the underlying JSON configuration files.
Namespace: Umbraco.Cms.Core.Configuration
Assembly: Umbraco.Core.dll
Syntax
public interface IConfigManipulator
Methods
View SourceRemoveConnectionStringAsync()
Removes the Umbraco database connection string from the most specific JSON configuration source that contains it (typically appsettings.{Environment}.json).
Declaration
Task RemoveConnectionStringAsync()
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
SaveConfigValueAsync(string, object)
Updates an existing value in the base JSON configuration source (typically appsettings.json).
Declaration
[Obsolete("This method is no longer used by Umbraco. Scheduled for removal in Umbraco 19.")]
Task SaveConfigValueAsync(string itemPath, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | itemPath | The path to update, using |
| object | value | The new value. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
Remarks
Will only update an existing key; if the key is not already present, nothing is saved.
SaveConnectionStringAsync(string, string?)
Saves the Umbraco database connection string to the most specific JSON configuration source available (typically appsettings.{Environment}.json),
so the value lives alongside the environment it applies to. Falls back to appsettings.json when no environment-specific source is present.
Declaration
Task SaveConnectionStringAsync(string connectionString, string? providerName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | connectionString | The connection string to save. |
| string | providerName | The optional provider name to save alongside the connection string. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
SaveDisableRedirectUrlTrackingAsync(bool)
Updates the redirect URL tracking setting in the base JSON configuration source (typically appsettings.json),
since the value applies across all environments. Creates the node if it does not already exist.
Declaration
[Obsolete("This method is no longer used by Umbraco. Set the Umbraco:CMS:WebRouting:DisableRedirectUrlTracking configuration key instead. Scheduled for removal in Umbraco 19.")]
Task SaveDisableRedirectUrlTrackingAsync(bool disable)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disable | The value to save. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
SetGlobalIdAsync(string)
Sets the global site identifier in the base JSON configuration source (typically appsettings.json),
since the value applies across all environments. Creates the node if it does not already exist.
Declaration
Task SetGlobalIdAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The identifier to save. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
SetImagingHmacSecretKeyAsync(string)
Sets the imaging HMAC secret key in the base JSON configuration source (typically appsettings.json),
since the value is recommended to be the same across all environments. Creates the node if it does not already exist.
Declaration
Task SetImagingHmacSecretKeyAsync(string base64Key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | base64Key | The base64-encoded key to save. |
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |