< Summary

Information
Class: Syki.Back.Features.Academic.CreateClass.ClassConfig
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/CreateClass/ClassConfig.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 26
Uncovered lines: 0
Coverable lines: 26
Total lines: 44
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.Student.CreateStudentEnrollment;
 2
 3namespace Syki.Back.Features.Academic.CreateClass;
 4
 5public class ClassConfig : IEntityTypeConfiguration<Class>
 6{
 7    public void Configure(EntityTypeBuilder<Class> @class)
 8    {
 29        @class.ToTable("classes");
 10
 211        @class.HasKey(c => c.Id);
 212        @class.Property(c => c.Id).ValueGeneratedNever();
 13
 214        @class.HasOne(c => c.Teacher)
 215            .WithMany()
 216            .HasForeignKey(c => c.TeacherId);
 17
 218        @class.HasOne(c => c.Discipline)
 219            .WithMany()
 220            .HasForeignKey(c => c.DisciplineId);
 21
 222        @class.HasMany(c => c.Schedules)
 223            .WithOne()
 224            .HasForeignKey(s => s.ClassId);
 25
 226        @class.HasMany(c => c.Lessons)
 227            .WithOne()
 228            .HasForeignKey(l => l.ClassId);
 29
 230        @class.HasOne(c => c.Period)
 231            .WithMany()
 232            .HasForeignKey(c => new { c.PeriodId, c.InstitutionId });
 33
 234        @class.HasMany(c => c.ExamGrades)
 235            .WithOne()
 236            .HasForeignKey(eg => eg.ClassId);
 37
 238        @class.HasMany(c => c.Students)
 239            .WithMany()
 240            .UsingEntity<ClassStudent>();
 41
 242        @class.Ignore(c => c.FillRatio);
 243    }
 44}