Files
components/LiteCharms.Features/Extensions/Postgres.cs
T
Khwezi Mngoma f4a615277f
continuous-integration/drone/pr Build is passing
Refactored AddDataProtectionDatabase
2026-06-14 10:11:25 +02:00

20 lines
654 B
C#

using LiteCharms.Features.Postgres;
namespace LiteCharms.Features.Extensions;
public static class Postgres
{
public const string SchedulerDbConfigName = "PostgresScheduler";
public const string DataProtectionDbConfigName = "PostgresDataProtection";
public static IServiceCollection AddDataProtectionDatabase(this IServiceCollection services, IConfiguration configuration)
{
var connectionString = configuration.GetConnectionString(DataProtectionDbConfigName);
services.AddPooledDbContextFactory<DataProtectionDbContext>(options =>
options.UseNpgsql(connectionString));
return services;
}
}