From 85c462a614ed3a9cca9e35071bb5ef68302b7cdb Mon Sep 17 00:00:00 2001 From: masiton Date: Sat, 5 Jul 2025 09:05:02 +0200 Subject: [PATCH] Updated generic resolution of Guid from config. --- .../Sources/Environment/EnvironmentConfigurationSource.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/MessengerApi.Configuration/Sources/Environment/EnvironmentConfigurationSource.cs b/code/MessengerApi.Configuration/Sources/Environment/EnvironmentConfigurationSource.cs index ca63b81..264c6ff 100644 --- a/code/MessengerApi.Configuration/Sources/Environment/EnvironmentConfigurationSource.cs +++ b/code/MessengerApi.Configuration/Sources/Environment/EnvironmentConfigurationSource.cs @@ -9,6 +9,12 @@ public T GetValue(string key) { + if (typeof(T).Equals(typeof(Guid))) + { + var guid = Guid.Parse(System.Environment.GetEnvironmentVariable(key)); + return (T)Convert.ChangeType(guid, typeof(T)); + } + return (T)Convert.ChangeType(System.Environment.GetEnvironmentVariable(key), typeof(T)); } }