feat: Konfigurierbare Tabellennamenregel in WebApiContextOptions hinzugefügt

- Einführung der WebApiContextOptions-Klasse mit einer Nullable-String-Eigenschaft `TableNamingRule`.
- Ermöglicht die Konfiguration von `TableNamingRule` über Anwendungseinstellungen (z.B. 'DIGITAL_DATA', 'PREPARED-SQL').
- Aktualisierte Dependency Injection-Einrichtung, um WebApiContextOptions aus der Konfiguration zu konfigurieren.
This commit is contained in:
Developer 02
2024-08-26 11:35:22 +02:00
parent 4387d62865
commit 1d8ae2c371
4 changed files with 356 additions and 8 deletions

View File

@@ -107,6 +107,8 @@ try
var cnnStr = WebApiConfig.ConnectionString(EN_ConnectionType.SQLServer);
builder.Services.Configure<WebApiContextOptions>(builder.Configuration.GetSection("WebApiContextOptions"));
builder.Services.AddDbContext<WebApiContext>(options =>
{
const int dbTimeoutInMin = 5;

View File

@@ -5,7 +5,8 @@
}
},
"ConnectionStrings": {
"sqlConnection": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
"sqlConnection": "Server=SDD-VMP04-SQL17\\DD_DEVELOP01;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;",
"sqlConnection19": "Server=SDD-VMP04-SQL19\\DD_DEVELOP01;Database=DD_StaffDB;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
},
"AppConfig": {
"LDAP_WebAppGroup_Is_Live": "false",
@@ -37,5 +38,11 @@
"LDAP_EDM_Prefix": "GG_EDM",
"LDAP_WebAppp_Prefix": "GG_WebApp",
"LDAP_Prefix_Test": "__Test"
},
// else if created with prepared crate table SQL,TableNamingRule is 'PREPARED-SQL' (e.g. dbo.Subsidiary, ecm.WindreamIndexToWindreamSearchToDepartment)
// else if you follow digital data SQL table naming rules, TableNamingRule is 'DIGITAL_DATA' (e.g. TBSTF_WEB_APP_ROLE)
// otherwise, TableNamingRule is 'PREPARED-SQL'
"WebApiContextOptions": {
"TableNamingRule": "DIGITAL_DATA"
}
}