-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLastFMConfig.cs
37 lines (34 loc) · 1017 Bytes
/
LastFMConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.IO;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
namespace LastFM.ReaderCore
{
public class LastFMConfig
{
public static IConfiguration _config = new ConfigurationBuilder()
#if DEBUG
.AddJsonFile($"appsettings.debug.json", false, true)
#else
.AddJsonFile($"appsettings.json", false, true)
.AddEnvironmentVariables()
#endif
.Build();
public static string getConfig(string configName)
{
return _config[configName];
}
/*
public static List<string> getConfigArray(string configName)
{
List<string> configItems = new List<string>();
IConfigurationSection configArray = _config.GetSection(configName);
foreach (var c in configArray.GetChildren())
{
configItems.Add(c.Value);
}
return configItems;
}
*/
}
}