Show / Hide Table of Contents

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 Source

ConfigurationRoot

Gets the configuration root.

Declaration
IConfigurationRoot ConfigurationRoot { get; }
Property Value
Type Description
IConfigurationRoot
| Improve this Doc View Source

RelativityInstance

Gets the Relativity instance configuration.

Declaration
RelativityInstanceConfiguration RelativityInstance { get; }
Property Value
Type Description
RelativityInstanceConfiguration

Methods

| Improve this Doc View Source

Get<T>()

Bind the configuration to a new instance of type T.

Declaration
T Get<T>()
Returns
Type Description
T

The new instance of T if successful, default(T) otherwise.

Type Parameters
Name Description
T

The type of the new instance to bind.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 T.

Type Parameters
Name Description
T

The type to convert the value to.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 defaultValue.

| Improve this Doc View Source

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 T if successful, default(T) otherwise.

Type Parameters
Name Description
T

The type to convert the value to.

| Improve this Doc View Source

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 T if successful, defaultValue otherwise.

Type Parameters
Name Description
T

The type to convert the value to.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX