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:
@@ -191,6 +191,10 @@ public class RecDbContext(DbContextOptions<RecDbContext> 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<RecAction>(b =>
|
||||
|
||||
Reference in New Issue
Block a user