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.
This commit is contained in:
2026-01-12 12:54:00 +01:00
parent bfe6c12ee0
commit 001f4bf2c5

View File

@@ -191,6 +191,10 @@ public class RecDbContext(DbContextOptions<RecDbContext> options) : DbContext(op
b.Property(e => e.FirstRun).HasColumnName("FIRST_RUN"); b.Property(e => e.FirstRun).HasColumnName("FIRST_RUN");
b.Property(e => e.LastRun).HasColumnName("LAST_RUN"); b.Property(e => e.LastRun).HasColumnName("LAST_RUN");
b.Property(e => e.LastResult).HasColumnName("LAST_RESULT"); b.Property(e => e.LastResult).HasColumnName("LAST_RESULT");
b.HasMany(e => e.Actions)
.WithOne(a => a.Profile)
.HasForeignKey(a => a.ProfileId);
}); });
modelBuilder.Entity<RecAction>(b => modelBuilder.Entity<RecAction>(b =>