The name of the variable with ??? should be called OrganizationId. I would create a separate class with the configuration for the model Teacher.
For example:
class TeacherConfiguration : IEntityTypeConfiguration<Teacher>
{
public void Configure(EntityTypeBuilder<BoardCard> builder)
{
builder.HasKey(bc => bc.Id);
builder.HasOne(bc => bc.Organization).WithMany(c => c.Teachers).HasForeignKey(bc => bc.OrganizationId).OnDelete(DeleteBehavior.Cascade).IsRequired();
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…