Files
components/LiteCharms.Features.MidrandBooks/Extensions/Postgres.cs
T

17 lines
550 B
C#

using LiteCharms.Features.MidrandBooks.Postgres;
namespace LiteCharms.Features.MidrandBooks.Extensions;
public static class Postgres
{
public const string MidrandBooksDbConfigName = "PostgresMidrandBooks";
public static IServiceCollection AddMidrandShopDatabase(this IServiceCollection services, IConfiguration configuration)
{
services.AddPooledDbContextFactory<MidrandBooksDbContext>(options =>
options.UseNpgsql(configuration.GetConnectionString(MidrandBooksDbConfigName)));
return services;
}
}