diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-01-22 16:48:26 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-01-22 16:48:26 -0600 |
| commit | fc9a1aacfb9c4e005fd482ba37394840865e9e61 (patch) | |
| tree | cc6101ad7014f1c504fea1e5118e6b47435bf51a /src/slskd/Common/Configuration.cs | |
| parent | 0210ab449f7546a90982a8cb28403f3d6af02230 (diff) | |
| download | slskd-fc9a1aacfb9c4e005fd482ba37394840865e9e61.tar.gz | |
wip
Diffstat (limited to 'src/slskd/Common/Configuration.cs')
| -rw-r--r-- | src/slskd/Common/Configuration.cs | 6 |
1 files changed, 2 insertions, 4 deletions
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<string>(property.Key); - Console.WriteLine($"key {property.Key} value {value}"); if (string.IsNullOrEmpty(value)) { - Console.WriteLine("skip"); continue; } |
