-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.cs
30 lines (25 loc) · 981 Bytes
/
Settings.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
using Microsoft.Extensions.Configuration;
namespace Neo.Plugins
{
internal class Settings
{
public string MongoHost { get; }
public string MongoPort { get; }
public string MongoUser { get; }
public string MongoPass { get; }
public ContractConfig[] ContractConfigs { get; }
public static Settings Default { get; private set; }
private Settings(IConfigurationSection section)
{
this.MongoHost = section.GetSection("MongoHost").Value;
this.MongoPort = section.GetSection("MongoPort").Value;
this.MongoUser = section.GetSection("MongoUser").Value;
this.MongoPass = section.GetSection("MongoPass").Value;
this.ContractConfigs = section.GetSection("Contracts").Get<ContractConfig[]>();
}
public static void Load(IConfigurationSection section)
{
Default = new Settings(section);
}
}
}