Changes in src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/StudentRepo.cs [2a9d9d1:7146ebb]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FinkiChattery/FinkiChattery.Persistence/Repositories/Implementations/StudentRepo.cs
r2a9d9d1 r7146ebb 1 1 using FinkiChattery.Persistence.Context; 2 2 using FinkiChattery.Persistence.Models; 3 using FinkiChattery.Persistence.Repositories.Contracts;4 3 using Microsoft.EntityFrameworkCore; 5 using System.Linq;6 4 using System.Threading.Tasks; 7 5 … … 18 16 return await DbSet.FirstOrDefaultAsync(x => x.ApplicationUserFk == applicationUserFk); 19 17 } 20 21 public async Task<StudentSelfDto> GetStudentSelfDto(long applicationUserFk)22 {23 return await DbSet24 .AsNoTracking()25 .Include(x => x.Questions)26 .Include(x => x.StudentTeams).ThenInclude(x => x.Team)27 .Where(x => x.ApplicationUserFk == applicationUserFk)28 .Select(x => new StudentSelfDto(x.Uid,29 x.ApplicationUserFk,30 x.IndexNumber,31 x.Reputation,32 x.ImageUrl,33 x.Questions.Select(y => new StudentQuestionDto(y.Uid, y.Title)),34 x.StudentTeams.Select(y => new StudentTeamDto(y.Team.Uid, y.Team.Name))))35 .FirstOrDefaultAsync();36 }37 18 } 38 19 }
Note:
See TracChangeset
for help on using the changeset viewer.