Class ConfigurationService
Provides a service for retrieving configuration settings.
Inheritance
Implements
Inherited Members
Namespace: DataWeb.Configuration
Assembly: DataWeb.Core.dll
Syntax
public class ConfigurationService : IConfigurationService
Constructors
ConfigurationService(IOptions<ConfigurationAppSettings>, IConfiguration)
Initializes a new instance of the ConfigurationService class.
Declaration
public ConfigurationService(IOptions<ConfigurationAppSettings> options, IConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
IOptions<ConfigurationAppSettings> | options | The Microsoft.Extensions.Options.IOptions<TOptions> instance containing the ConfigurationAppSettings. |
IConfiguration | configuration | The Microsoft.Extensions.Configuration.IConfiguration instance. |
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. |
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. |