Skip to content

Commit

Permalink
updated postgresContext
Browse files Browse the repository at this point in the history
  • Loading branch information
HaikAsatryan committed Jan 7, 2025
1 parent c2ed9d3 commit 821a45f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/Pandatech.VerticalSlices/Context/PostgresContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
namespace Pandatech.VerticalSlices.Context;

//dotnet ef migrations add --project src\Pandatech.VerticalSlices\Pandatech.VerticalSlices.csproj --configuration Debug --output-dir Context/Migrations
public class PostgresContext : PostgresFunctions, IOutboxDbContext, IInboxDbContext
public class PostgresContext(DbContextOptions<PostgresContext> options)
: PostgresFunctions(options), IOutboxDbContext, IInboxDbContext
{
public PostgresContext(DbContextOptions<PostgresContext> options) : base(options)
{
this.UseAuditPropertyValidation();
}

public DbSet<Token> Tokens { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<UserConfig> UserConfigs { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Pandatech.VerticalSlices/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
.AddDistributedSignalR("DistributedSignalR")
.MapDefaultTimeZone()
.AddCors()
.AddPostgresContext<PostgresContext>(builder.Configuration.GetPostgresUrl())
.AddPostgresContextPool<PostgresContext>(builder.Configuration.GetPostgresUrl())
.AddGridify()
.AddMassTransit(AssemblyRegistry.ToArray())
.AddAes256Key(builder.Configuration.GetAesKey())
Expand Down

0 comments on commit 821a45f

Please sign in to comment.