Files
blazor-hrm/Infrastructure/Database/PostgreSQL/PostgreSQLConfiguration.cs
T
2026-07-21 14:08:10 +07:00

17 lines
574 B
C#

namespace Indotalent.Infrastructure.Database.PostgreSQL;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
public static class PostgreSQLConfiguration
{
public static IServiceCollection AddPostgreSQLContext<TContext>(this IServiceCollection services, string connectionString)
where TContext : DbContext
{
services.AddDbContext<TContext>(options =>
options.UseNpgsql(connectionString, m =>
m.MigrationsAssembly(typeof(TContext).Assembly.FullName)));
return services;
}
}