From 001f4bf2c5103716340f35b7b2944080d4cca41b Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 12 Jan 2026 12:54:00 +0100 Subject: [PATCH] Configure one-to-many relationship for Profile-Actions Added entity mapping to establish a one-to-many relationship between profiles and actions, with actions referencing their parent profile via the ProfileId 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 7335aed..00bb8b5 100644 --- a/src/ReC.Infrastructure/RecDbContext.cs +++ b/src/ReC.Infrastructure/RecDbContext.cs @@ -191,6 +191,10 @@ public class RecDbContext(DbContextOptions options) : DbContext(op b.Property(e => e.FirstRun).HasColumnName("FIRST_RUN"); b.Property(e => e.LastRun).HasColumnName("LAST_RUN"); b.Property(e => e.LastResult).HasColumnName("LAST_RESULT"); + + b.HasMany(e => e.Actions) + .WithOne(a => a.Profile) + .HasForeignKey(a => a.ProfileId); }); modelBuilder.Entity(b =>