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