Ignore:
Timestamp:
09/15/26 21:15:53 (8 days ago)
Author:
Stefan-Saveski <stefansaveski19@…>
Branches:
master
Children:
a12988e, c42181c
Parents:
10009b9
Message:
  • ready for presentation
Location:
iknow-api/Repository/Implementations
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • iknow-api/Repository/Implementations/RefreshTokenRepository.cs

    r10009b9 rea40556  
    4141                    rt.Token == refreshTokenDto.token &&
    4242                    rt.IsValid &&
    43                     rt.ExpiresAt > DateTime.UtcNow);
     43                    rt.ExpiresAt > DateTime.SpecifyKind(DateTime.UtcNow, DateTimeKind.Unspecified));
    4444
    4545            return token != null;
  • iknow-api/Repository/Implementations/UserRepository.cs

    r10009b9 rea40556  
    2828            return await _context.User
    2929                .Include(u => u.ContactInfo)
    30                 .Include(u => u.EnrollmentInfo)
    3130                .Include(u => u.HighSchool)
     31                // The study programme is reached through the enrolment, since
     32                // Major hangs off EnrolledSemesters rather than off Users.
     33                .Include(u => u.Enrolments!)
     34                    .ThenInclude(es => es.Major)
     35                .Include(u => u.Enrolments!)
     36                    .ThenInclude(es => es.Semester)
     37                .AsSplitQuery()
    3238                .FirstOrDefaultAsync(u => u.Id == id);
    3339        }
     
    4854            await _context.SaveChangesAsync();
    4955        }
    50         public async Task AddEnrollmentAsync(EnrollmentInfo enrollment)
    51         {
    52             _context.EnrollmentInfo.Add(enrollment);
    53             await _context.SaveChangesAsync();
    54         }   
    5556        public async Task AddHighSchoolAsync(HighSchool highSchool)
    5657        {
     
    8990                .Include(ps => ps.SemesterSubject)
    9091                    .ThenInclude(ss => ss.Professor)
    91                 .Where(ps => ps.SemesterSubject.UserId == id)
     92                // The ER model reaches the student through the enrolment,
     93                // not through a user_id on semesters_subjects.
     94                .Where(ps => ps.SemesterSubject.EnrolledSemester.UserId == id)
    9295                .ToListAsync();
    9396        }
Note: See TracChangeset for help on using the changeset viewer.