Skip to content

Commit 821a45f

Browse files
committed
updated postgresContext
1 parent c2ed9d3 commit 821a45f

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Pandatech.VerticalSlices/Context/PostgresContext.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99
namespace Pandatech.VerticalSlices.Context;
1010

1111
//dotnet ef migrations add --project src\Pandatech.VerticalSlices\Pandatech.VerticalSlices.csproj --configuration Debug --output-dir Context/Migrations
12-
public class PostgresContext : PostgresFunctions, IOutboxDbContext, IInboxDbContext
12+
public class PostgresContext(DbContextOptions<PostgresContext> options)
13+
: PostgresFunctions(options), IOutboxDbContext, IInboxDbContext
1314
{
14-
public PostgresContext(DbContextOptions<PostgresContext> options) : base(options)
15-
{
16-
this.UseAuditPropertyValidation();
17-
}
18-
1915
public DbSet<Token> Tokens { get; set; }
2016
public DbSet<User> Users { get; set; }
2117
public DbSet<UserConfig> UserConfigs { get; set; }

src/Pandatech.VerticalSlices/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.AddDistributedSignalR("DistributedSignalR")
3939
.MapDefaultTimeZone()
4040
.AddCors()
41-
.AddPostgresContext<PostgresContext>(builder.Configuration.GetPostgresUrl())
41+
.AddPostgresContextPool<PostgresContext>(builder.Configuration.GetPostgresUrl())
4242
.AddGridify()
4343
.AddMassTransit(AssemblyRegistry.ToArray())
4444
.AddAes256Key(builder.Configuration.GetAesKey())

0 commit comments

Comments
 (0)