< Summary - Syki

Information
Class: Syki.Back.Features.Academic.GetEnrollmentPeriods.GetEnrollmentPeriodsService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/GetEnrollmentPeriods/GetEnrollmentPeriodsService.cs
Tag: 4_16869239191
Line coverage
100%
Covered lines: 14
Uncovered lines: 0
Coverable lines: 14
Total lines: 20
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
.ctor(...)100%11100%
Get()100%11100%
<Get()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/GetEnrollmentPeriods/GetEnrollmentPeriodsService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Academic.GetEnrollmentPeriods;
 2
 23public class GetEnrollmentPeriodsService(SykiDbContext ctx, HybridCache cache) : IAcademicService
 4{
 5    public async Task<List<EnrollmentPeriodOut>> Get(Guid institutionId)
 6    {
 27        return await cache.GetOrCreateAsync(
 28            key: $"enrollmentPeriods:{institutionId}",
 29            state: (ctx, institutionId),
 210            factory: async (state, _) =>
 211            {
 212                var data = await state.ctx.EnrollmentPeriods.AsNoTracking()
 213                    .Where(c => c.InstitutionId == state.institutionId)
 214                    .OrderBy(p => p.Id)
 215                    .ToListAsync();
 416                return data.ConvertAll(c => c.ToOut());
 217            }
 218        );
 219    }
 20}