-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfiguration.cs
More file actions
28 lines (24 loc) · 844 Bytes
/
Configuration.cs
File metadata and controls
28 lines (24 loc) · 844 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
namespace Blog;
public static class Configuration
{
public static string JwtKey { get; private set; }
public static string ApiKeyName { get; private set; }
public static string ApiKey { get; private set; }
public static SmtpConfiguration Smtp { get; private set; }
public static void Load(IConfiguration configuration)
{
JwtKey = configuration["JwtKey"];
ApiKeyName = configuration["ApiKeyName"];
ApiKey = configuration["ApiKey"];
var smtp = new SmtpConfiguration();
configuration.GetSection("SmtpConfiguration").Bind(smtp);
Smtp = smtp;
}
public class SmtpConfiguration
{
public string Host { get; set; }
public int Port { get; set; } = 25;
public string UserName { get; set; }
public string Password { get; set; }
}
}