|
|
|
@ -4,26 +4,26 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
|
|
|
|
|
|
|
|
|
|
namespace Volo.Abp.EntityFrameworkCore
|
|
|
|
|
{
|
|
|
|
|
public static class AbpDbContextOptionsSqlServerExtensions
|
|
|
|
|
public static class AbpDbContextOptionsPostgreSqlExtensions
|
|
|
|
|
{
|
|
|
|
|
public static void UsePostgreSql(
|
|
|
|
|
[NotNull] this AbpDbContextOptions options,
|
|
|
|
|
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> sqlServerOptionsAction = null)
|
|
|
|
|
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
|
|
|
|
|
{
|
|
|
|
|
options.Configure(context =>
|
|
|
|
|
{
|
|
|
|
|
context.UsePostgreSql(sqlServerOptionsAction);
|
|
|
|
|
context.UsePostgreSql(postgreSqlOptionsAction);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void UsePostgreSql<TDbContext>(
|
|
|
|
|
[NotNull] this AbpDbContextOptions options,
|
|
|
|
|
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> sqlServerOptionsAction = null)
|
|
|
|
|
[CanBeNull] Action<NpgsqlDbContextOptionsBuilder> postgreSqlOptionsAction = null)
|
|
|
|
|
where TDbContext : AbpDbContext<TDbContext>
|
|
|
|
|
{
|
|
|
|
|
options.Configure<TDbContext>(context =>
|
|
|
|
|
{
|
|
|
|
|
context.UsePostgreSql(sqlServerOptionsAction);
|
|
|
|
|
context.UsePostgreSql(postgreSqlOptionsAction);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|