This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using LiteCharms.Features.TechShop.Postgres;
|
||||
|
||||
namespace LiteCharms.Features.TechShop.Extensions;
|
||||
|
||||
public static class Postgres
|
||||
{
|
||||
public const string ShopDbConfigName = "PostgresShop";
|
||||
|
||||
public static IServiceCollection AddTechShopDatabase(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddPooledDbContextFactory<ShopDbContext>(options =>
|
||||
options.UseNpgsql(configuration.GetConnectionString(ShopDbConfigName)));
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user