-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppInfo.cs
More file actions
29 lines (22 loc) · 798 Bytes
/
AppInfo.cs
File metadata and controls
29 lines (22 loc) · 798 Bytes
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
using Microsoft.Extensions.Configuration;
using System.Collections.Generic;
using System.Linq;
namespace NetPro.Checker
{
public class AppInfo
{
public Dictionary<string, string> RequestHeaders { get; set; }
public List<string> ConfigProviders { get; } = new List<string>();
public IEnumerable<KeyValuePair<string, string>> Configs { get; private set; }
public static AppInfo GetAppInfo(IConfiguration configuration)
{
var info = new AppInfo();
foreach (var provider in ((IConfigurationRoot)configuration).Providers.ToList())
{
info.ConfigProviders.Add(provider.ToString());
}
info.Configs = configuration.AsEnumerable();
return info;
}
}
}