-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQLConfiguration.cs
More file actions
113 lines (97 loc) · 3.11 KB
/
Copy pathSQLConfiguration.cs
File metadata and controls
113 lines (97 loc) · 3.11 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
using FeatureOne.Cache;
namespace FeatureOne.SQL
{
public class SQLConfiguration
{
public SQLConfiguration()
{
FeatureTable = new FeatureTable();
CacheSettings = new CacheSettings();
ConnectionSettings = new ConnectionSettings();
}
/// <summary>
/// Database settings - Connection string and provider name.
/// </summary>
public ConnectionSettings ConnectionSettings { get; set; }
/// <summary>
/// Feature table name and column aliases
/// </summary>
public FeatureTable FeatureTable { get; set; }
/// <summary>
/// Feature cache settings.
/// </summary>
public CacheSettings CacheSettings { get; set; }
}
public class ConnectionSettings
{
/// <summary>
/// Connection string to feature database.
/// </summary>
public string ConnectionString { get; set; }
/// <summary>
/// Provider name for connection factory. Please see DbProviderName class for supported constants.
/// </summary>
/// <remarks>
/// Supported providers:
/// System.Data.SqlClient
/// System.Data.Odbc
/// System.Data.OleDb
/// System.Data.SQLite
/// MySql.Data.MySqlClient
/// Npgsql
/// </remarks>
public string ProviderName { get; set; } = DbProviderName.MSSql;
}
/// <summary>
/// Provider name for connection factories.
/// </summary>
public class DbProviderName
{
/// <summary>
/// Provider - System.Data.SqlClient
/// </summary>
public const string MSSql = "System.Data.SqlClient";
/// <summary>
/// Provider - System.Data.Odbc
/// </summary>
public const string Odbc = "System.Data.Odbc";
/// <summary>
/// Provider - System.Data.OleDb
/// </summary>
public const string OleDb = "System.Data.OleDb";
/// <summary>
/// Provider - System.Data.SqlClient
/// </summary>
public const string SQLite = "System.Data.SQLite";
/// <summary>
/// Provider - MySql.Data.MySqlClient
/// </summary>
public const string MySql = "MySql.Data.MySqlClient";
/// <summary>
/// Provider - Npgsql
/// </summary>
public const string PostgresSql = "Npgsql";
}
/// <summary>
/// Feature table settings to override table aliases.
/// </summary>
public class FeatureTable
{
/// <summary>
/// Table Name for the feature table.
/// </summary>
public string TableName { get; set; } = "TFeatures";
/// <summary>
/// Feature name column name.
/// </summary>
public string NameColumn { get; set; } = "Name";
/// <summary>
/// Feature toggle column name.
/// </summary>
public string ToggleColumn { get; set; } = "Toggle";
/// <summary>
/// Feature archived column name.
/// </summary>
public string ArchivedColumn { get; set; } = "Archived";
}
}