fix: BasicConfiguration not working properly with enum types

This commit is contained in:
2026-04-15 15:06:47 +03:00
parent 212ff3c890
commit 0767e00bde

View File

@@ -12,7 +12,7 @@ public class BasicConfiguration : IConfiguration
public IReadOnlyDictionary<string, object?> Values => values; public IReadOnlyDictionary<string, object?> Values => values;
public T Get<T>(string key, T defaultValue) => Get<T>(key) ?? defaultValue; public T Get<T>(string key, T defaultValue) => Has(key) ? Get<T>(key) ?? defaultValue : defaultValue;
public T? Get<T>(string key) public T? Get<T>(string key)
{ {
if (!values.TryGetValue(key, out object? value)) if (!values.TryGetValue(key, out object? value))