Interface IConfigurationService
Represents the configuration service that provides a set of members for getting the configuration parameters.
Namespace: Relativity.Testing.Framework.Configuration
Assembly: Relativity.Testing.Framework.dll
Syntax
public interface IConfigurationService
Properties
| Improve this Doc View SourceConfigurationRoot
Gets the configuration root.
Declaration
IConfigurationRoot ConfigurationRoot { get; }
Property Value
Type | Description |
---|---|
IConfigurationRoot |
RelativityInstance
Gets the Relativity instance configuration.
Declaration
RelativityInstanceConfiguration RelativityInstance { get; }
Property Value
Type | Description |
---|---|
RelativityInstanceConfiguration |
Methods
| Improve this Doc View SourceGet<T>()
Bind the configuration to a new instance of type T
.
Declaration
T Get<T>()
Returns
Type | Description |
---|---|
T | The new instance of |
Type Parameters
Name | Description |
---|---|
T | The type of the new instance to bind. |
GetValue(String)
Gets the string configuration value by the specified key
.
Throws ConfigurationKeyNotFoundException if the configuration by the specified key
is not found.
Declaration
string GetValue(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the configuration value. |
Returns
Type | Description |
---|---|
System.String | The configuration value. |
GetValue<T>(String)
Gets the configuration value/section by the specified key
and converts it to a new instance of type T
.
Throws ConfigurationKeyNotFoundException if the configuration by the specified key
is not found.
Declaration
T GetValue<T>(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the configuration value/section. |
Returns
Type | Description |
---|---|
T | The new instance of |
Type Parameters
Name | Description |
---|---|
T | The type to convert the value to. |
GetValueOrDefault(String)
Gets the configuration value by the specified key
or null if not found.
Declaration
string GetValueOrDefault(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the configuration value. |
Returns
Type | Description |
---|---|
System.String | The configuration value or null. |
GetValueOrDefault(String, String)
Gets the configuration value by the specified key or defaultValue
if not found.
Declaration
string GetValueOrDefault(string key, string defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the configuration value. |
System.String | defaultValue | The default value to use if no value is found. |
Returns
Type | Description |
---|---|
System.String | The configuration value or |
GetValueOrDefault<T>(String)
Gets the configuration value/section by the specified key
and converts it to a new instance of type T
;
or default(T)
if not found.
Declaration
T GetValueOrDefault<T>(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the configuration value/section. |
Returns
Type | Description |
---|---|
T | The new instance of |
Type Parameters
Name | Description |
---|---|
T | The type to convert the value to. |
GetValueOrDefault<T>(String, T)
Gets the configuration value/section by the specified key
and converts it to a new instance of type T
;
or defaultValue
if not found.
Declaration
T GetValueOrDefault<T>(string key, T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key of the configuration value/section. |
T | defaultValue | The default value to use if no value is found. |
Returns
Type | Description |
---|---|
T | The new instance of |
Type Parameters
Name | Description |
---|---|
T | The type to convert the value to. |