From e48c5e207584428b3cf0b5a7a49dc6f4af6ca302 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 25 Feb 2024 14:23:46 +0100 Subject: [PATCH] Enable Dapper and update its service registration The Dapper usage flag has been set to true in the Elsa.Server.Web program. Additionally, in the Dapper feature, the DbConnectionProvider is now registered as a singleton instead of scoped, reflecting changes in the database connection strategy. --- src/bundles/Elsa.Server.Web/Program.cs | 2 +- src/modules/Elsa.Dapper/Features/DapperFeature.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bundles/Elsa.Server.Web/Program.cs b/src/bundles/Elsa.Server.Web/Program.cs index c0bdc67f0..ec8a8263b 100644 --- a/src/bundles/Elsa.Server.Web/Program.cs +++ b/src/bundles/Elsa.Server.Web/Program.cs @@ -25,7 +25,7 @@ using Proto.Persistence.SqlServer; const bool useMongoDb = false; const bool useSqlServer = false; -const bool useDapper = false; +const bool useDapper = true; const bool useProtoActor = false; const bool useHangfire = false; const bool useQuartz = true; diff --git a/src/modules/Elsa.Dapper/Features/DapperFeature.cs b/src/modules/Elsa.Dapper/Features/DapperFeature.cs index 1853c928d..90194cdd5 100644 --- a/src/modules/Elsa.Dapper/Features/DapperFeature.cs +++ b/src/modules/Elsa.Dapper/Features/DapperFeature.cs @@ -30,6 +30,6 @@ public class DapperFeature : FeatureBase /// public override void Apply() { - Services.AddScoped(DbConnectionProvider); + Services.AddSingleton(DbConnectionProvider); } } \ No newline at end of file