< Summary

Information
Class: Syki.Back.Features.Teacher.CreateLessonAttendance.LessonAttendanceConfig
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Teacher/CreateLessonAttendance/LessonAttendanceConfig.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 26
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/Teacher/CreateLessonAttendance/LessonAttendanceConfig.cs

#LineLine coverage
 1using Syki.Back.Features.Academic.CreateClass;
 2using Syki.Back.Features.Academic.CreateStudent;
 3
 4namespace Syki.Back.Features.Teacher.CreateLessonAttendance;
 5
 6public class LessonAttendanceConfig : IEntityTypeConfiguration<LessonAttendance>
 7{
 8    public void Configure(EntityTypeBuilder<LessonAttendance> lessonAttendance)
 9    {
 210        lessonAttendance.ToTable("lesson_attendances");
 11
 212        lessonAttendance.HasKey(t => t.Id);
 213        lessonAttendance.Property(t => t.Id).ValueGeneratedNever();
 14
 215        lessonAttendance.HasIndex(t => new { t.LessonId, t.StudentId })
 216            .IsUnique();
 17
 218        lessonAttendance.HasOne<SykiStudent>()
 219            .WithMany()
 220            .HasForeignKey(t => t.StudentId);
 21
 222        lessonAttendance.HasOne<Class>()
 223            .WithMany()
 224            .HasForeignKey(t => t.ClassId);
 225    }
 26}