Class ConfigurationService
Provides a service for retrieving configuration settings.
Implements
Inherited Members
Namespace: DataWeb.Configuration
Assembly: DataWeb.Core.dll
Syntax
public class ConfigurationService : IConfigurationService
Remarks
Initializes a new instance of the ConfigurationService class.
Constructors
ConfigurationService(IOptions<ConfigurationAppSettings>, IConfiguration)
Provides a service for retrieving configuration settings.
Declaration
public ConfigurationService(IOptions<ConfigurationAppSettings> options, IConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
IOptions<ConfigurationAppSettings> | options | The IOptions<TOptions> instance containing the ConfigurationAppSettings. |
IConfiguration | configuration | The IConfiguration instance. |
Remarks
Initializes a new instance of the ConfigurationService class.
Methods
GetAppSetting(string)
Retrieves a specific application setting value by its name.
Declaration
public string GetAppSetting(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the application setting. |
Returns
Type | Description |
---|---|
string | A string representing the value of the application setting. |
GetAppSetting<T>(string)
Retrieves a specific application setting value by its name.
Declaration
public T GetAppSetting<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the application setting. |
Returns
Type | Description |
---|---|
T | The value of the application setting. |
Type Parameters
Name | Description |
---|---|
T |
GetAppSettings()
Retrieves the application settings.
Declaration
public ConfigurationAppSettings GetAppSettings()
Returns
Type | Description |
---|---|
ConfigurationAppSettings | A ConfigurationAppSettings instance containing the application settings. |
GetConnectionString(string)
Retrieves a connection string value by its name.
Declaration
public string GetConnectionString(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the connection string. |
Returns
Type | Description |
---|---|
string | A string representing the value of the connection string. |
GetSetting(string)
Retrieves a specific configuration setting value by its full name.
Declaration
public string GetSetting(string fullName)
Parameters
Type | Name | Description |
---|---|---|
string | fullName | The full name of the configuration setting. |
Returns
Type | Description |
---|---|
string | A string representing the value of the configuration setting. |
GetSetting<T>(string)
Retrieves a specific configuration setting value by its full name.
Declaration
public T GetSetting<T>(string fullName)
Parameters
Type | Name | Description |
---|---|---|
string | fullName | The full name of the configuration setting. |
Returns
Type | Description |
---|---|
T | The value of the configuration setting. |
Type Parameters
Name | Description |
---|---|
T |