Skip to content

Commit

Permalink
Use two navigation property of DispenserDTO in `TransactionDetailDT…
Browse files Browse the repository at this point in the history
…O` (#38)
  • Loading branch information
ArdenHide authored Dec 17, 2024
1 parent f3aa993 commit 1de8309
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/DispenserProvider.DataBase/DispenserContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.OnDelete(DeleteBehavior.Restrict);

entity.HasOne(e => e.WithdrawalDetail)
.WithOne(e => e.Dispenser)
.WithOne(e => e.WithdrawalDispenser)
.HasForeignKey<DispenserDTO>(e => e.WithdrawalDetailId)
.OnDelete(DeleteBehavior.Restrict);

entity.HasOne(e => e.RefundDetail)
.WithOne()
.WithOne(e => e.RefundDispenser)
.HasForeignKey<DispenserDTO>(e => e.RefundDetailId)
.OnDelete(DeleteBehavior.Restrict);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public class TransactionDetailDTO
public long PoolId { get; set; }

public virtual List<BuilderDTO> Builders { get; set; } = [];
public virtual DispenserDTO Dispenser { get; set; } = null!;
public virtual DispenserDTO WithdrawalDispenser { get; set; } = null!;
public virtual DispenserDTO RefundDispenser { get; set; } = null!;
}

0 comments on commit 1de8309

Please sign in to comment.