< Summary

Information
Class: Syki.Back.Features.Academic.CreateCourseOffering.OfertaConfig
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/CreateCourseOffering/CourseOfferingConfig.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 31
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/CreateCourseOffering/CourseOfferingConfig.cs

#LineLine coverage
 1using Syki.Back.Features.Academic.CreateStudent;
 2using Syki.Back.Features.Academic.CreateAcademicPeriod;
 3
 4namespace Syki.Back.Features.Academic.CreateCourseOffering;
 5
 6public class OfertaConfig : IEntityTypeConfiguration<CourseOffering>
 7{
 8    public void Configure(EntityTypeBuilder<CourseOffering> courseOffering)
 9    {
 210        courseOffering.ToTable("course_offerings");
 11
 212        courseOffering.HasKey(o => o.Id);
 213        courseOffering.Property(o => o.Id).ValueGeneratedNever();
 14
 215        courseOffering.HasOne(o => o.Course)
 216            .WithMany()
 217            .HasForeignKey(o => o.CourseId);
 18
 219        courseOffering.HasOne(o => o.CourseCurriculum)
 220            .WithMany()
 221            .HasForeignKey(o => o.CourseCurriculumId);
 22
 223        courseOffering.HasOne<AcademicPeriod>()
 224            .WithMany()
 225            .HasForeignKey(o => new { o.Period, o.InstitutionId });
 26
 227        courseOffering.HasMany<SykiStudent>()
 228            .WithOne(a => a.CourseOffering)
 229            .HasForeignKey(a => a.CourseOfferingId);
 230    }
 31}