Changeset ea40556 for iknow-api/Repository/Implementations
- Timestamp:
- 09/15/26 21:15:53 (8 days ago)
- Branches:
- master
- Children:
- a12988e, c42181c
- Parents:
- 10009b9
- Location:
- iknow-api/Repository/Implementations
- Files:
-
- 1 added
- 2 edited
-
ProfRepository.cs (added)
-
RefreshTokenRepository.cs (modified) (1 diff)
-
UserRepository.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/Repository/Implementations/RefreshTokenRepository.cs
r10009b9 rea40556 41 41 rt.Token == refreshTokenDto.token && 42 42 rt.IsValid && 43 rt.ExpiresAt > DateTime. UtcNow);43 rt.ExpiresAt > DateTime.SpecifyKind(DateTime.UtcNow, DateTimeKind.Unspecified)); 44 44 45 45 return token != null; -
iknow-api/Repository/Implementations/UserRepository.cs
r10009b9 rea40556 28 28 return await _context.User 29 29 .Include(u => u.ContactInfo) 30 .Include(u => u.EnrollmentInfo)31 30 .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() 32 38 .FirstOrDefaultAsync(u => u.Id == id); 33 39 } … … 48 54 await _context.SaveChangesAsync(); 49 55 } 50 public async Task AddEnrollmentAsync(EnrollmentInfo enrollment)51 {52 _context.EnrollmentInfo.Add(enrollment);53 await _context.SaveChangesAsync();54 }55 56 public async Task AddHighSchoolAsync(HighSchool highSchool) 56 57 { … … 89 90 .Include(ps => ps.SemesterSubject) 90 91 .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) 92 95 .ToListAsync(); 93 96 }
Note:
See TracChangeset
for help on using the changeset viewer.
