Class SiteConfigurationRepository
Contains static access to global site configuration key values.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0Syntax
[ServiceConfiguration(typeof(ISiteConfigurationRepository))]
public class SiteConfigurationRepository : ISiteConfigurationRepository
Constructors
SiteConfigurationRepository(ServiceAccessor<SiteConfigDB>)
Initializes a new instance of the SiteConfigurationRepository class.
Declaration
public SiteConfigurationRepository(ServiceAccessor<SiteConfigDB> dataAccess)
Parameters
Type | Name | Description |
---|---|---|
ServiceAccessor<SiteConfigDB> | dataAccess | The data access. |
Fields
UniqueIdKey
Represents the key used to store a Unique ID for a site in the site configuration.
Declaration
public static readonly string UniqueIdKey
Field Value
Type | Description |
---|---|
System.String |
WebConfigKey
Represents the key used to store Web.Config for a site in the site configuration.
Declaration
public static readonly string WebConfigKey
Field Value
Type | Description |
---|---|
System.String |
Methods
DeleteValue(String, String)
Deletes the configuration value associated with the provided site and key.
Declaration
public void DeleteValue(string siteId, string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | siteId | The id of the site that the value should be associated with. |
System.String | key | The key that the value should be associated with. |
GetInstance()
Gets an instance of the currently configurated ISiteConfigurationRepository.
Declaration
public static ISiteConfigurationRepository GetInstance()
Returns
Type | Description |
---|---|
ISiteConfigurationRepository |
GetValue(String, String)
Gets the configuration value associated with the provided site and key.
Declaration
public string GetValue(string siteId, string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | siteId | The id of the site that the value is associated with. |
System.String | key | The key that the value is associated with. |
Returns
Type | Description |
---|---|
System.String | Configuration string if found; otherwise |
GetValues(String)
Gets a dictionary with all the configuration value associated with the provided key where the key of the returned dictionary is the site id.
Declaration
public IDictionary<string, string> GetValues(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key that the value is associated with. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | A dictionary with the site and configuration value. |
SetValue(String, String, String)
Sets the configuration value and associates it with the provided site and key.
Declaration
public void SetValue(string siteId, string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | siteId | The id of the site that the value should be associated with. |
System.String | key | The key that the value should be associated with. |
System.String | value | The value that should be associated with the provided site and key. |