Class ConfigurationValue<T>
- Assembly
- FoundationaLLM.Common.dll
Provides a strongly typed configuration value with support for per-user exceptions.
public class ConfigurationValue<T>
Type Parameters
T
The type of the configuration value
- Inheritance
-
ConfigurationValue<T>
- Inherited Members
- Extension Methods
Properties
Exceptions
Gets or sets the list of exceptions to the configuration value.
[JsonPropertyName("value_exceptions")]
public List<ConfigurationValueException<T>> Exceptions { get; set; }
Property Value
Value
Gets or sets the value of the configuration entry.
[JsonPropertyName("value")]
public required T Value { get; set; }
Property Value
- T
Methods
Deserialize(string)
Deserializes a JSON string into a ConfigurationValue<T>.
public static ConfigurationValue<T> Deserialize(string json)
Parameters
json
stringThe serialized representation of the configuration value.
Returns
- ConfigurationValue<T>
A ConfigurationValue<T> providing the configuration value.
GetValueForUser(string)
Gets the value of the configuration entry for the specified user.
public T GetValueForUser(string userPrincipalName)
Parameters
userPrincipalName
stringThe user principal name (UPN) of the user.
Returns
- T
The configuration value.
Remarks
The method returns the user-specific value if an active exception exists for the user. If not, the method returns the default value.