Skip to content

Commit dce4723

Browse files
refactor(DbContext): simplify AppDbContext constructor declaration
Use primary constructor syntax introduced in C# 12 to reduce boilerplate code
1 parent 907e1ba commit dce4723

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Infrastructure/DbContexts/AppDbContext.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
using PaymentCoreServiceApi.Core.Entities.UserGenerated;
44

55
namespace PaymentCoreServiceApi.Infrastructure.DbContexts;
6-
public class AppDbContext: DbContext
6+
7+
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
78
{
8-
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
9-
{
10-
}
119
public DbSet<User> Users { get; set; }
1210
public DbSet<BankAccount> BankAccounts { get; set; }
1311

14-
//dotnet ef database update
12+
//dotnet ef database update
1513
}

0 commit comments

Comments
 (0)