Skip to content

Commit

Permalink
ExpenseApplication/Infrastructure/Entities/Expense.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
rsemihkoca committed Jan 18, 2024
1 parent 61e298d commit a0b1807
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ExpenseApplication/Infrastructure/Entities/Expense.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public void Configure(EntityTypeBuilder<Expense> builder)
// .OnDelete(DeleteBehavior.Restrict); // Prevent deletion of ExpenseCategory if it is referenced by an Expense

builder.HasOne(e => e.PaymentInstruction)
.WithMany()
.HasForeignKey(e => e.PaymentMethod);
.WithOne(e => e.Expense)
.HasForeignKey<PaymentInstruction>(p => p.ExpenseRequestId);

// .OnDelete(DeleteBehavior.Restrict); // Prevent deletion of PaymentInstruction if it is referenced by an Expense


Expand Down

0 comments on commit a0b1807

Please sign in to comment.