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.
This commit is contained in:
2026-01-12 12:47:21 +01:00
parent 8b86eca838
commit e1260e49f0

View File

@@ -262,6 +262,10 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<ResultView>(b =>