From fc9a1aacfb9c4e005fd482ba37394840865e9e61 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 22 Jan 2021 16:48:26 -0600 Subject: wip --- src/slskd/Common/Configuration.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/slskd/Common/Configuration.cs') diff --git a/src/slskd/Common/Configuration.cs b/src/slskd/Common/Configuration.cs index 621c150e..fca57299 100644 --- a/src/slskd/Common/Configuration.cs +++ b/src/slskd/Common/Configuration.cs @@ -22,9 +22,9 @@ public static class Configuration { - public static void Populate(this IConfiguration configuration, [CallerMemberName] string caller = default(string)) + public static void Populate(this IConfiguration configuration, Type targetType = null, [CallerMemberName] string caller = default(string)) { - var type = GetCallingType(caller); + var type = targetType ?? GetCallingType(caller); var targetProperties = GetTargetProperties(type); foreach (var property in targetProperties) @@ -32,11 +32,9 @@ var propertyType = property.Value.PropertyType; string value = configuration.GetValue(property.Key); - Console.WriteLine($"key {property.Key} value {value}"); if (string.IsNullOrEmpty(value)) { - Console.WriteLine("skip"); continue; } -- cgit v1.2.3