-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataBaseConfig.cs
More file actions
29 lines (25 loc) · 1.08 KB
/
DataBaseConfig.cs
File metadata and controls
29 lines (25 loc) · 1.08 KB
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 AzureDevopsTracker.Extensions;
using System;
using System.Runtime.InteropServices;
namespace AzureDevopsTracker.Data
{
public class DataBaseConfig
{
public DataBaseConfig(string connectionsString, string schemaName = "dbo", TimeZoneInfo timeZoneInfo = null)
{
if (connectionsString.IsNullOrEmpty())
throw new ArgumentException("The ConnectionsString is required");
if (timeZoneInfo is null)
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time");
else
timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("Brazil/East");
ConnectionsString = connectionsString;
SchemaName = schemaName;
TimeZoneInfo = timeZoneInfo;
}
public static string ConnectionsString { get; private set; }
public static string SchemaName { get; private set; }
public static TimeZoneInfo TimeZoneInfo { get; private set; }
}
}