< Summary - Syki

Information
Class: Syki.Back.Features.Academic.CreateClass.ClassConfig
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/CreateClass/ClassConfig.cs
Tag: 4_16869239191
Line coverage
100%
Covered lines: 32
Uncovered lines: 0
Coverable lines: 32
Total lines: 53
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Configure(...)100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/CreateClass/ClassConfig.cs

#LineLine coverage
 1using Syki.Back.Features.Academic.CreateCampus;
 2using Syki.Back.Features.Student.CreateStudentEnrollment;
 3
 4namespace Syki.Back.Features.Academic.CreateClass;
 5
 6public class ClassConfig : IEntityTypeConfiguration<Class>
 7{
 8    public void Configure(EntityTypeBuilder<Class> @class)
 9    {
 210        @class.ToTable("classes");
 11
 212        @class.HasKey(c => c.Id);
 213        @class.Property(c => c.Id).ValueGeneratedNever();
 14
 215        @class.HasOne<Campus>()
 216            .WithMany()
 217            .HasForeignKey(c => c.CampusId);
 18
 219        @class.HasOne(c => c.Teacher)
 220            .WithMany()
 221            .HasForeignKey(c => c.TeacherId);
 22
 223        @class.HasOne(c => c.Discipline)
 224            .WithMany()
 225            .HasForeignKey(c => c.DisciplineId);
 26
 227        @class.HasMany(c => c.Schedules)
 228            .WithOne()
 229            .HasForeignKey(s => s.ClassId);
 30
 231        @class.HasMany(c => c.Lessons)
 232            .WithOne()
 233            .HasForeignKey(l => l.ClassId);
 34
 235        @class.HasMany(c => c.Activities)
 236            .WithOne()
 237            .HasForeignKey(a => a.ClassId);
 38
 239        @class.HasOne(c => c.Period)
 240            .WithMany()
 241            .HasForeignKey(c => new { c.PeriodId, c.InstitutionId });
 42
 243        @class.HasMany(c => c.Notes)
 244            .WithOne()
 245            .HasForeignKey(eg => eg.ClassId);
 46
 247        @class.HasMany(c => c.Students)
 248            .WithMany()
 249            .UsingEntity<ClassStudent>();
 50
 251        @class.Ignore(c => c.FillRatio);
 252    }
 53}