Files
components/LiteCharms.Features/Extensions/Postgres.cs
T
Khwezi Mngoma 7d5e9a18d8
continuous-integration/drone/pr Build is failing
Added MidrandShop feature and spl;it extensions and healthchecks
2026-05-23 11:48:47 +02:00

28 lines
1015 B
C#

using LiteCharms.Features.MidrandShop.Postgres;
using LiteCharms.Features.Shop.Postgres;
namespace LiteCharms.Features.Extensions;
public static class Postgres
{
public const string MidrandShopDbConfigName = "PostgresMidrandShop";
public const string ShopDbConfigName = "PostgresShop";
public const string SchedulerDbConfigName = "PostgresScheduler";
public static IServiceCollection AddShopDatabase(this IServiceCollection services, IConfiguration configuration)
{
services.AddPooledDbContextFactory<ShopDbContext>(options =>
options.UseNpgsql(configuration.GetConnectionString(ShopDbConfigName)));
return services;
}
public static IServiceCollection AddMidrandShopDatabase(this IServiceCollection services, IConfiguration configuration)
{
services.AddPooledDbContextFactory<MidrandShopDbContext>(options =>
options.UseNpgsql(configuration.GetConnectionString(MidrandShopDbConfigName)));
return services;
}
}