-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathHrSettings.cs
33 lines (28 loc) · 1.19 KB
/
HrSettings.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
namespace MyEf.Hr.Business;
/// <summary>
/// Provides the <see cref="IConfiguration"/> settings.
/// </summary>
public class HrSettings : SettingsBase
{
/// <summary>
/// Gets the setting prefixes in order of precedence.
/// </summary>
public static string[] Prefixes { get; } = ["Hr/", "Common/"];
/// <summary>
/// Initializes a new instance of the <see cref="HrSettings"/> class.
/// </summary>
/// <param name="configuration">The <see cref="IConfiguration"/>.</param>
public HrSettings(IConfiguration configuration) : base(configuration, Prefixes) => ValidationArgs.DefaultUseJsonNames = true;
/// <summary>
/// Gets the database connection string.
/// </summary>
public string DatabaseConnectionString => GetRequiredValue<string>("ConnectionStrings__Database");
/// <summary>
/// Gets the Azure service bus connection string.
/// </summary>
public string ServiceBusConnectionString => GetRequiredValue<string>("ConnectionStrings__ServiceBus");
/// <summary>
/// Gets the Azure storage connection string.
/// </summary>
public string StorageConnectionString => GetRequiredValue<string>("ConnectionStrings__Storage");
}