22.348. Class ConfigurationExt

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

Extends the functionality of the

public static class ConfigurationExt

22.348.1. Inheritance

objectConfigurationExt

22.348.2. Inherited Members

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

22.348.3. Methods

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

22.348.3.1.1. Parameters

configuration IConfiguration

Configurations used to populate the class

key string

Path to the Object in the configuration

22.348.3.1.2. Returns

T

The initialized object

22.348.3.1.3. Type Parameters

T

Type of the options class

22.348.3.2. GetRequiredValue<T>(IConfiguration, string)

Configure an object with the given configuration.

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

22.348.3.2.1. Parameters

configuration IConfiguration

Configurations used to populate the class

key string

Path to the Object in the configuration

22.348.3.2.2. Returns

T

The initialized object

22.348.3.2.3. Type Parameters

T

Type of the options class

22.348.3.2.4. Exceptions

InvalidOperationException

the key is not found in the configurations.