Class SiteConfigurationRepository
Contains static access to global site configuration key values.
Inheritance
Implements
Namespace: EPiServer.DataAbstraction.Internal
Assembly: EPiServer.dll
Version: 12.0.3Syntax
[ServiceConfiguration]
public class SiteConfigurationRepository : Object, ISiteConfigurationRepositoryConstructors
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 UniqueIdKeyField 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 WebConfigKeyField 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. | 
