17 lines
515 B
C#
17 lines
515 B
C#
using LiteCharms.Features.TechShop.Postgres;
|
|
|
|
namespace LiteCharms.Features.TechShop.Extensions;
|
|
|
|
public static class Postgres
|
|
{
|
|
public const string TechShopDbConfigName = "PostgresShop";
|
|
|
|
public static IServiceCollection AddTechShopDatabase(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
services.AddPooledDbContextFactory<ShopDbContext>(options =>
|
|
options.UseNpgsql(configuration.GetConnectionString(TechShopDbConfigName)));
|
|
|
|
return services;
|
|
}
|
|
}
|