Skip to content

Commit 307b9e6

Browse files
author
daveywyliedev
committed
config Changes
1 parent 0ab9b67 commit 307b9e6

8 files changed

Lines changed: 9 additions & 17 deletions

File tree

DbLocalizer.Tests/appsettings.Test.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"ConnectionStrings": {
1111
"LocalizationTest": "Server=localhost;Initial Catalog=LocalizationTest;User Id={0};Password={1};MultipleActiveResultSets=True;TrustServerCertificate=True"
1212
},
13-
"ExportEndPoint": "https://localhost:44310/api/ExportFileService",
14-
"ImportEndPoint": "https://localhost:44310/api/ImportFileService",
1513
"UseScheduler": "false",
1614
"ScheduledExportCron": "0 0 6 ? * MON *",
1715
"ScheduledImportPurgeCron": "0 0 6 ? * FRI *",

DbLocalizer/appsettings.Development.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"ConnectionStrings": {
1111
"LocalizationTest": "Server=localhost;Initial Catalog=LocalizationTest;User Id={0};Password={1};MultipleActiveResultSets=True;TrustServerCertificate=True"
1212
},
13-
"ExportEndPoint": "https://localhost:44310/api/ExportFileService",
14-
"ImportEndPoint": "https://localhost:44310/api/ImportFileService",
1513
"UseScheduler": "false",
1614
"ScheduledExportCron": "0 0 6 ? * MON *",
1715
"ScheduledImportPurgeCron": "0 0 6 ? * FRI *",

DbLocalizer/appsettings.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
"ConnectionStrings": {
1111
"LocalizationTest": "Server=localhost;Initial Catalog=LocalizationTest;User Id={0};Password={1};MultipleActiveResultSets=True;TrustServerCertificate=True"
1212
},
13-
"ExportEndPoint": "https://localhost:44310/api/ExportFileService",
14-
"ImportEndPoint": "https://localhost:44310/api/ImportFileService",
1513
"UseScheduler": "false",
1614
"ScheduledExportCron": "0 0 6 ? * MON *",
1715
"ScheduledImportPurgeCron": "0 0 6 ? * FRI *",

DbLocalizer/databases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name": "LocalizationTest",
55
"ConnectionStringName": "LocalizationTest",
66
"SourceLocale": "en-US",
7-
"CultureTableSuffix": "Culture",
7+
"LocalizedTableSuffix": "Localized",
88
"TableExclusions": [
99
"__EFMigrationsHistory",
1010
"__RefactorLog",

Entities/AppSettings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
{
33
public class AppSettings
44
{
5-
public string ExportEndPoint { get; set; }
6-
public string ImportEndPoint { get; set; }
75
public string UseScheduler { get; set; }
86
public string ScheduledExportCron { get; set; }
97
public string ScheduledImportPurgeCron { get; set; }

Entities/Configuration/DatabaseConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class DatabaseConfigItem
1212
public string Name { get; set; }
1313
public string ConnectionStringName { get; set; }
1414
public string SourceLocale { get; set; }
15-
public string CultureTableSuffix { get; set; }
15+
public string LocalizedTableSuffix { get; set; }
1616
public List<string> TableExclusions { get; set; } = new List<string>();
1717
public List<string> ExportDataTypes { get; set; } = new List<string>();
1818
public List<string> ColumnExclusions { get; set; } = new List<string>();

Entities/Databases.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private void BuildDatabases()
3131
Name = dbConfigItem.Name,
3232
ConnectionStringName = dbConfigItem.ConnectionStringName,
3333
SourceLocale = dbConfigItem.SourceLocale,
34-
CultureTableSuffix = dbConfigItem.CultureTableSuffix,
34+
LocalizedTableSuffix = dbConfigItem.LocalizedTableSuffix,
3535
TableExclusions = dbConfigItem.TableExclusions,
3636
ExportDataTypes = dbConfigItem.ExportDataTypes,
3737
ColumnExclusions = dbConfigItem.ColumnExclusions,
@@ -75,7 +75,7 @@ public Database(ISqlSchemaBuilder sqlSchemaBuilder)
7575
public string Name { get; set; }
7676
public string ConnectionStringName { get; set; }
7777
public string SourceLocale { get; set; }
78-
public string CultureTableSuffix { get; set; }
78+
public string LocalizedTableSuffix { get; set; }
7979
public string ConnectionStringValue { get; set; }
8080
public bool HasSchemaObjects { get; set; } = false;
8181
public bool CanConnect { get; set; } = false;

Entities/Utilities/SqlUtility.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Entities.Utilities
99
{
1010
public class SqlUtility
1111
{
12-
private static string _cultureTableSuffix = string.Empty;
12+
private static string _localizedTableSuffix = string.Empty;
1313
public string ExportLookbackInDays { get; set; }
1414
public List<string> ExclusionList { get; set; }
1515
public DataTable BaseTables { get; set; }
@@ -31,7 +31,7 @@ FROM INFORMATION_SCHEMA.TABLES AS SC1
3131

3232
public SqlUtility(Database database)
3333
{
34-
_cultureTableSuffix = database.CultureTableSuffix;
34+
_localizedTableSuffix = database.LocalizedTableSuffix;
3535

3636
if (database.TableExclusions != null && database.TableExclusions.Count > 0)
3737
{
@@ -98,10 +98,10 @@ public string GetBaseTables()
9898
tablesToExclude = " AND SC1.TABLE_NAME NOT IN (" + exclusionList + ")";
9999
}
100100

101-
if (!string.IsNullOrEmpty(_cultureTableSuffix))
101+
if (!string.IsNullOrEmpty(_localizedTableSuffix))
102102
{
103-
fullCultureTableName = "MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME + '" + _cultureTableSuffix + "')) AS 'FullCultureTableName',";
104-
cultureTable = " AND SC1.TABLE_NAME NOT LIKE '%" + _cultureTableSuffix + "%'";
103+
fullCultureTableName = "MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME + '" + _localizedTableSuffix + "')) AS 'FullCultureTableName',";
104+
cultureTable = " AND SC1.TABLE_NAME NOT LIKE '%" + _localizedTableSuffix + "%'";
105105
}
106106

107107
return string.Format(_sqlGetAllTables, fullCultureTableName, tablesToExclude, cultureTable);

0 commit comments

Comments
 (0)