| | 1 | | namespace Syki.Back.Features.Cross.CreateInstitution; |
| | 2 | |
|
| | 3 | | public class InstitutionConfig : IEntityTypeConfiguration<Institution> |
| | 4 | | { |
| | 5 | | public void Configure(EntityTypeBuilder<Institution> institution) |
| | 6 | | { |
| 2 | 7 | | institution.ToTable("institutions"); |
| | 8 | |
|
| 2 | 9 | | institution.HasKey(f => f.Id); |
| 2 | 10 | | institution.Property(f => f.Id).ValueGeneratedNever(); |
| | 11 | |
|
| 2 | 12 | | institution.HasMany(f => f.AcademicPeriods) |
| 2 | 13 | | .WithOne() |
| 2 | 14 | | .HasForeignKey(p => p.InstitutionId); |
| | 15 | |
|
| 2 | 16 | | institution.HasMany(f => f.Campi) |
| 2 | 17 | | .WithOne() |
| 2 | 18 | | .HasForeignKey(c => c.InstitutionId); |
| | 19 | |
|
| 2 | 20 | | institution.HasMany(f => f.Courses) |
| 2 | 21 | | .WithOne() |
| 2 | 22 | | .HasForeignKey(c => c.InstitutionId); |
| | 23 | |
|
| 2 | 24 | | institution.HasMany(f => f.CourseOfferings) |
| 2 | 25 | | .WithOne() |
| 2 | 26 | | .HasForeignKey(co => co.InstitutionId); |
| | 27 | |
|
| 2 | 28 | | institution.HasMany(f => f.CourseCurriculums) |
| 2 | 29 | | .WithOne() |
| 2 | 30 | | .HasForeignKey(g => g.InstitutionId); |
| | 31 | |
|
| 2 | 32 | | institution.HasMany(f => f.Disciplines) |
| 2 | 33 | | .WithOne() |
| 2 | 34 | | .HasForeignKey(d => d.InstitutionId); |
| | 35 | |
|
| 2 | 36 | | institution.HasMany(f => f.Teachers) |
| 2 | 37 | | .WithOne() |
| 2 | 38 | | .HasForeignKey(p => p.InstitutionId); |
| | 39 | |
|
| 2 | 40 | | institution.HasMany(f => f.Students) |
| 2 | 41 | | .WithOne() |
| 2 | 42 | | .HasForeignKey(a => a.InstitutionId); |
| | 43 | |
|
| 2 | 44 | | institution.HasMany(i => i.Users) |
| 2 | 45 | | .WithOne() |
| 2 | 46 | | .HasForeignKey(u => u.InstitutionId); |
| | 47 | |
|
| 2 | 48 | | institution.HasMany(f => f.Classrooms) |
| 2 | 49 | | .WithOne() |
| 2 | 50 | | .HasForeignKey(c => c.InstitutionId); |
| | 51 | |
|
| 2 | 52 | | institution.HasMany(i => i.Webhooks) |
| 2 | 53 | | .WithOne() |
| 2 | 54 | | .HasForeignKey(u => u.InstitutionId); |
| | 55 | |
|
| 2 | 56 | | institution.HasMany(i => i.WebhookCalls) |
| 2 | 57 | | .WithOne() |
| 2 | 58 | | .HasForeignKey(u => u.InstitutionId); |
| | 59 | |
|
| 2 | 60 | | institution.HasMany(f => f.Notifications) |
| 2 | 61 | | .WithOne() |
| 2 | 62 | | .HasForeignKey(n => n.InstitutionId); |
| 2 | 63 | | } |
| | 64 | | } |