From b7daf718f69b941b0e1cc30c6af6791b1f8fa6a2 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sat, 7 Oct 2023 23:29:19 +0200 Subject: [PATCH] Remove incorrect default connection string values --- Elsa.sln.DotSettings | 2 ++ .../Elsa.EntityFrameworkCore.MySql/Features.cs | 14 +++++++------- .../Features.cs | 14 +++++++------- .../Modules/Runtime/Extensions.cs | 17 ----------------- .../{Extensions.cs => Features.cs} | 14 +++++++------- 5 files changed, 23 insertions(+), 38 deletions(-) create mode 100644 Elsa.sln.DotSettings delete mode 100644 src/modules/Elsa.EntityFrameworkCore.PostgreSql/Modules/Runtime/Extensions.cs rename src/modules/Elsa.EntityFrameworkCore.SqlServer/{Extensions.cs => Features.cs} (82%) diff --git a/Elsa.sln.DotSettings b/Elsa.sln.DotSettings new file mode 100644 index 000000000..62957f8ce --- /dev/null +++ b/Elsa.sln.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file diff --git a/src/modules/Elsa.EntityFrameworkCore.MySql/Features.cs b/src/modules/Elsa.EntityFrameworkCore.MySql/Features.cs index 3c3df4ac0..e21748a98 100644 --- a/src/modules/Elsa.EntityFrameworkCore.MySql/Features.cs +++ b/src/modules/Elsa.EntityFrameworkCore.MySql/Features.cs @@ -19,7 +19,7 @@ public static class MySqlProvidersExtensions /// /// Configures the to use MySql. /// - public static EFCoreIdentityPersistenceFeature UseMySql(this EFCoreIdentityPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreIdentityPersistenceFeature UseMySql(this EFCoreIdentityPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaMySql(Assembly, connectionString, options); return feature; @@ -28,7 +28,7 @@ public static class MySqlProvidersExtensions /// /// Configures the to use MySql. /// - public static EFCoreAlterationsPersistenceFeature UseMySql(this EFCoreAlterationsPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreAlterationsPersistenceFeature UseMySql(this EFCoreAlterationsPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaMySql(Assembly, connectionString, options); return feature; @@ -37,7 +37,7 @@ public static class MySqlProvidersExtensions /// /// Configures the to use MySql. /// - public static EFCoreLabelPersistenceFeature UseMySql(this EFCoreLabelPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreLabelPersistenceFeature UseMySql(this EFCoreLabelPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaMySql(Assembly, connectionString, options); return feature; @@ -46,7 +46,7 @@ public static class MySqlProvidersExtensions /// /// Configures the to use MySql. /// - public static EFCoreWorkflowDefinitionPersistenceFeature UseMySql(this EFCoreWorkflowDefinitionPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowDefinitionPersistenceFeature UseMySql(this EFCoreWorkflowDefinitionPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaMySql(Assembly, connectionString, options); return feature; @@ -55,7 +55,7 @@ public static class MySqlProvidersExtensions /// /// Configures the to use MySql. /// - public static EFCoreWorkflowInstancePersistenceFeature UseMySql(this EFCoreWorkflowInstancePersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowInstancePersistenceFeature UseMySql(this EFCoreWorkflowInstancePersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaMySql(Assembly, connectionString, options); return feature; @@ -64,7 +64,7 @@ public static class MySqlProvidersExtensions /// /// Configures the to use MySql. /// - public static WorkflowManagementPersistenceFeature UseMySql(this WorkflowManagementPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static WorkflowManagementPersistenceFeature UseMySql(this WorkflowManagementPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaMySql(Assembly, connectionString, options); return feature; @@ -73,7 +73,7 @@ public static class MySqlProvidersExtensions /// /// Configures the to use MySql. /// - public static EFCoreWorkflowRuntimePersistenceFeature UseMySql(this EFCoreWorkflowRuntimePersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowRuntimePersistenceFeature UseMySql(this EFCoreWorkflowRuntimePersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaMySql(Assembly, connectionString, options); return feature; diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Features.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Features.cs index 9baaa5763..3bfee3284 100644 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Features.cs +++ b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Features.cs @@ -19,7 +19,7 @@ public static class PostgreSqlProvidersExtensions /// /// Configures the to use PostgreSQL. /// - public static EFCoreIdentityPersistenceFeature UsePostgreSql(this EFCoreIdentityPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreIdentityPersistenceFeature UsePostgreSql(this EFCoreIdentityPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(Assembly, connectionString, options); return feature; @@ -28,7 +28,7 @@ public static class PostgreSqlProvidersExtensions /// /// Configures the to use PostgreSQL. /// - public static EFCoreAlterationsPersistenceFeature UsePostgreSql(this EFCoreAlterationsPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreAlterationsPersistenceFeature UsePostgreSql(this EFCoreAlterationsPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(Assembly, connectionString, options); return feature; @@ -37,7 +37,7 @@ public static class PostgreSqlProvidersExtensions /// /// Configures the to use PostgreSQL. /// - public static EFCoreLabelPersistenceFeature UsePostgreSql(this EFCoreLabelPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreLabelPersistenceFeature UsePostgreSql(this EFCoreLabelPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(Assembly, connectionString, options); return feature; @@ -46,7 +46,7 @@ public static class PostgreSqlProvidersExtensions /// /// Configures the to use PostgreSQL. /// - public static EFCoreWorkflowDefinitionPersistenceFeature UsePostgreSql(this EFCoreWorkflowDefinitionPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowDefinitionPersistenceFeature UsePostgreSql(this EFCoreWorkflowDefinitionPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(Assembly, connectionString, options); return feature; @@ -55,7 +55,7 @@ public static class PostgreSqlProvidersExtensions /// /// Configures the to use PostgreSQL. /// - public static EFCoreWorkflowInstancePersistenceFeature UsePostgreSql(this EFCoreWorkflowInstancePersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowInstancePersistenceFeature UsePostgreSql(this EFCoreWorkflowInstancePersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(Assembly, connectionString, options); return feature; @@ -64,7 +64,7 @@ public static class PostgreSqlProvidersExtensions /// /// Configures the to use PostgreSQL. /// - public static WorkflowManagementPersistenceFeature UsePostgreSql(this WorkflowManagementPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static WorkflowManagementPersistenceFeature UsePostgreSql(this WorkflowManagementPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(Assembly, connectionString, options); return feature; @@ -73,7 +73,7 @@ public static class PostgreSqlProvidersExtensions /// /// Configures the to use PostgreSQL. /// - public static EFCoreWorkflowRuntimePersistenceFeature UsePostgreSql(this EFCoreWorkflowRuntimePersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowRuntimePersistenceFeature UsePostgreSql(this EFCoreWorkflowRuntimePersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(Assembly, connectionString, options); return feature; diff --git a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Modules/Runtime/Extensions.cs b/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Modules/Runtime/Extensions.cs deleted file mode 100644 index 9ddfc09d1..000000000 --- a/src/modules/Elsa.EntityFrameworkCore.PostgreSql/Modules/Runtime/Extensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Elsa.EntityFrameworkCore.Common; -using Elsa.EntityFrameworkCore.Modules.Runtime; - -// ReSharper disable once CheckNamespace -namespace Elsa.EntityFrameworkCore.Extensions; - -public static partial class Extensions -{ - /// - /// Configures the to use PostgreSql. - /// - public static EFCoreWorkflowRuntimePersistenceFeature UsePostgreSql(this EFCoreWorkflowRuntimePersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) - { - feature.DbContextOptionsBuilder = (_, db) => db.UseElsaPostgreSql(connectionString, options); - return feature; - } -} diff --git a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Extensions.cs b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Features.cs similarity index 82% rename from src/modules/Elsa.EntityFrameworkCore.SqlServer/Extensions.cs rename to src/modules/Elsa.EntityFrameworkCore.SqlServer/Features.cs index 24e7d4f72..973d31599 100644 --- a/src/modules/Elsa.EntityFrameworkCore.SqlServer/Extensions.cs +++ b/src/modules/Elsa.EntityFrameworkCore.SqlServer/Features.cs @@ -19,7 +19,7 @@ public static class SqlServerProvidersExtensions /// /// Configures the to use SQL Server. /// - public static EFCoreIdentityPersistenceFeature UseSqlServer(this EFCoreIdentityPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreIdentityPersistenceFeature UseSqlServer(this EFCoreIdentityPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(Assembly, connectionString, options); return feature; @@ -28,7 +28,7 @@ public static class SqlServerProvidersExtensions /// /// Configures the to use SQL Server. /// - public static EFCoreAlterationsPersistenceFeature UseSqlServer(this EFCoreAlterationsPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreAlterationsPersistenceFeature UseSqlServer(this EFCoreAlterationsPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(Assembly, connectionString, options); return feature; @@ -37,7 +37,7 @@ public static class SqlServerProvidersExtensions /// /// Configures the to use SQL Server. /// - public static EFCoreLabelPersistenceFeature UseSqlServer(this EFCoreLabelPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreLabelPersistenceFeature UseSqlServer(this EFCoreLabelPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(Assembly, connectionString, options); return feature; @@ -46,7 +46,7 @@ public static class SqlServerProvidersExtensions /// /// Configures the to use SQL Server. /// - public static EFCoreWorkflowDefinitionPersistenceFeature UseSqlServer(this EFCoreWorkflowDefinitionPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowDefinitionPersistenceFeature UseSqlServer(this EFCoreWorkflowDefinitionPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(Assembly, connectionString, options); return feature; @@ -55,7 +55,7 @@ public static class SqlServerProvidersExtensions /// /// Configures the to use SQL Server. /// - public static EFCoreWorkflowInstancePersistenceFeature UseSqlServer(this EFCoreWorkflowInstancePersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowInstancePersistenceFeature UseSqlServer(this EFCoreWorkflowInstancePersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(Assembly, connectionString, options); return feature; @@ -64,7 +64,7 @@ public static class SqlServerProvidersExtensions /// /// Configures the to use SQL Server. /// - public static WorkflowManagementPersistenceFeature UseSqlServer(this WorkflowManagementPersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static WorkflowManagementPersistenceFeature UseSqlServer(this WorkflowManagementPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(Assembly, connectionString, options); return feature; @@ -73,7 +73,7 @@ public static class SqlServerProvidersExtensions /// /// Configures the to use SQL Server. /// - public static EFCoreWorkflowRuntimePersistenceFeature UseSqlServer(this EFCoreWorkflowRuntimePersistenceFeature feature, string connectionString = Constants.DefaultConnectionString, ElsaDbContextOptions? options = default) + public static EFCoreWorkflowRuntimePersistenceFeature UseSqlServer(this EFCoreWorkflowRuntimePersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = default) { feature.DbContextOptionsBuilder = (_, db) => db.UseElsaSqlServer(Assembly, connectionString, options); return feature;