From f4a615277f51b290ff1f4f9a054e90467d2479a2 Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Sun, 14 Jun 2026 10:11:25 +0200 Subject: [PATCH] Refactored AddDataProtectionDatabase --- LiteCharms.Features/Extensions/Postgres.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/LiteCharms.Features/Extensions/Postgres.cs b/LiteCharms.Features/Extensions/Postgres.cs index cba918b..8defd2c 100644 --- a/LiteCharms.Features/Extensions/Postgres.cs +++ b/LiteCharms.Features/Extensions/Postgres.cs @@ -11,16 +11,8 @@ public static class Postgres { var connectionString = configuration.GetConnectionString(DataProtectionDbConfigName); - var dataSourceBuilder = new NpgsqlDataSourceBuilder(connectionString); - - dataSourceBuilder.ConfigureTypeLoading(options => { options.EnableTypeLoading(false); }); - - var dataSource = dataSourceBuilder.Build(); - - services.AddSingleton(dataSource); - services.AddPooledDbContextFactory(options => - options.UseNpgsql(dataSource)); + options.UseNpgsql(connectionString)); return services; }