< Summary

Information
Class: Syki.Back.Features.Academic.GetTeachers.GetTeachersService
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Features/Academic/GetTeachers/GetTeachersService.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 18
Uncovered lines: 0
Coverable lines: 18
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
.ctor(...)100%11100%
Get()100%11100%

File(s)

/home/runner/work/syki/syki/Back/Features/Academic/GetTeachers/GetTeachersService.cs

#LineLine coverage
 1namespace Syki.Back.Features.Academic.GetTeachers;
 2
 13public class GetTeachersService(SykiDbContext ctx) : IAcademicService
 4{
 5    public async Task<List<TeacherOut>> Get(Guid institutionId)
 6    {
 17        FormattableString sql = $@"
 18            SELECT
 19                t.id,
 110                t.name,
 111                u.email
 112            FROM
 113                syki.teachers t
 114            INNER JOIN
 115                syki.users u ON u.id = t.id
 116            WHERE
 117                u.institution_id = {institutionId}
 118            ORDER BY
 119                t.name
 120        ";
 21
 122        var teachers = await ctx.Database.SqlQuery<TeacherOut>(sql).ToListAsync();
 23
 124        return teachers;
 125    }
 26}