21.351. Class ConfigurationExt

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

Extends the functionality of the

public static class ConfigurationExt

21.351.1. Inheritance

objectConfigurationExt

21.351.2. Inherited Members

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

21.351.3. Methods

21.351.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()

21.351.3.1.1. Parameters

configuration IConfiguration

Configurations used to populate the class

key string

Path to the Object in the configuration

21.351.3.1.2. Returns

T

The initialized object

21.351.3.1.3. Type Parameters

T

Type of the options class

21.351.3.2. GetRequiredValue<T>(IConfiguration, string)

Configure an object with the given configuration.

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

21.351.3.2.1. Parameters

configuration IConfiguration

Configurations used to populate the class

key string

Path to the Object in the configuration

21.351.3.2.2. Returns

T

The initialized object

21.351.3.2.3. Type Parameters

T

Type of the options class

21.351.3.2.4. Exceptions

InvalidOperationException

the key is not found in the configurations.