From e1260e49f0c418e6d0e56511c3dee2da66cea13f Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 12 Jan 2026 12:47:21 +0100 Subject: [PATCH] Add one-to-many Action-Results relationship mapping Added entity configuration to define a one-to-many relationship between Actions and Results. Each Action can have multiple Results, and each Result references its parent Action via the ActionId foreign key. --- src/ReC.Infrastructure/RecDbContext.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ReC.Infrastructure/RecDbContext.cs b/src/ReC.Infrastructure/RecDbContext.cs index 1e504cf..7335aed 100644 --- a/src/ReC.Infrastructure/RecDbContext.cs +++ b/src/ReC.Infrastructure/RecDbContext.cs @@ -262,6 +262,10 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.PostprocessingQuery).HasColumnName("POSTPROCESSING_QUERY"); b.Property(e => e.ErrorAction).HasColumnName("ERROR_ACTION_ID"); b.Property(e => e.ErrorActionName).HasColumnName("ERROR_ACTION"); + + b.HasMany(e => e.Results) + .WithOne(r => r.Action) + .HasForeignKey(r => r.ActionId); }); modelBuilder.Entity(b =>