Changeset 1d32d5c for iknow-api/Repository
- Timestamp:
- 10/28/25 10:51:44 (11 months ago)
- Branches:
- master
- Children:
- f844b7e
- Parents:
- 28759eb (diff), e423ff3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- Boris Gjorgjievski <69085722+imbrsk@…> (10/28/25 10:51:44)
- git-committer:
- GitHub <noreply@…> (10/28/25 10:51:44)
- Location:
- iknow-api/Repository
- Files:
-
- 2 edited
-
Implementations/UserRepository.cs (modified) (2 diffs)
-
Interface/IUserRepository.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/Repository/Implementations/UserRepository.cs
r28759eb r1d32d5c 24 24 return await _context.User.FirstOrDefaultAsync(u => u.Email == username); 25 25 } 26 27 public async Task<User?> GetUserByIdAsync(int id) 28 { 29 return await _context.User 30 .Include(u => u.ContactInfo) 31 .Include(u => u.EnrollmentInfo) 32 .Include(u => u.HighSchool) 33 .FirstOrDefaultAsync(u => u.Id == id); 34 } 35 36 26 37 public async Task<User?> GetOnlyUserByIdAsync(int id) 27 38 { … … 33 44 await _context.SaveChangesAsync(); 34 45 } 46 public async Task AddContactAsync(ContactInfo contactInfo) 47 { 48 _context.ContactInfo.Add(contactInfo); 49 await _context.SaveChangesAsync(); 50 } 51 public async Task AddEnrollmentAsync(EnrollmentInfo enrollment) 52 { 53 _context.EnrollmentInfo.Add(enrollment); 54 await _context.SaveChangesAsync(); 55 } 56 public async Task AddHighSchoolAsync(HighSchool highSchool) 57 { 58 _context.HighSchool.Add(highSchool); 59 await _context.SaveChangesAsync(); 60 } 35 61 36 62 public async Task<int> GetUsersCountAsync() -
iknow-api/Repository/Interface/IUserRepository.cs
r28759eb r1d32d5c 7 7 Task<User?> GetUserByUsernameAsync(string username); 8 8 Task AddUserAsync(User user); 9 Task AddContactAsync(ContactInfo contactInfo); 10 Task AddEnrollmentAsync(EnrollmentInfo enrollment); 11 Task AddHighSchoolAsync(HighSchool highSchool); 9 12 Task<int> GetUsersCountAsync(); 13 Task<User> GetUserByIdAsync(int id); 10 14 Task<User?> GetOnlyUserByIdAsync(int id); 11 15
Note:
See TracChangeset
for help on using the changeset viewer.
