17.344. Class ConfigurationExt

Namespace: ArmoniK.Core.Utils
Assembly: ArmoniK.Core.Utils.dll

Extends the functionality of the

public static class ConfigurationExt

17.344.1. Inheritance

objectConfigurationExt

17.344.2. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

17.344.3. Methods

17.344.3.1. GetInitializedValue<T>(IConfiguration, string)

Configure an object with the given configuration. If the object is not found in the configuration, a new object in returned.

public static T GetInitializedValue<T>(this IConfiguration configuration, string key) where T : new()

17.344.3.1.1. Parameters

configuration IConfiguration

Configurations used to populate the class

key string

Path to the Object in the configuration

17.344.3.1.2. Returns

T

The initialized object

17.344.3.1.3. Type Parameters

T

Type of the options class

17.344.3.2. GetRequiredValue<T>(IConfiguration, string)

Configure an object with the given configuration.

public static T GetRequiredValue<T>(this IConfiguration configuration, string key)

17.344.3.2.1. Parameters

configuration IConfiguration

Configurations used to populate the class

key string

Path to the Object in the configuration

17.344.3.2.2. Returns

T

The initialized object

17.344.3.2.3. Type Parameters

T

Type of the options class

17.344.3.2.4. Exceptions

InvalidOperationException

the key is not found in the configurations.