Esempio n. 1
0
 public TruncatedUser Map(Applicant applicant)
 {
     return new TruncatedUser
     {
         Banned = applicant.Banned,
         Email = applicant.Email,
         Birthdate = applicant.Birthdate,
         Id = applicant.Id,
         Image = applicant.Image,
         Name = applicant.Name,
         Sex = applicant.Sex,
         Surname = applicant.Surname,
         UserName = applicant.UserName
     };
 }
 public TruncatedApplicant Map(Applicant applicant)
 {
     return new TruncatedApplicant
     {
         Banned = applicant.Banned,
         Birthdate = applicant.Birthdate,
         Id = applicant.Id,
         Image = applicant.Image,
         Name = applicant.Name,
         Sex = applicant.Sex,
         Surname = applicant.Surname,
         UserName = applicant.UserName,
         PhoneNumber = applicant.PhoneNumber,
         Specialities = applicant.Specialities.Select(s => _truncatedSpecialitiesMapper.Map(s)).ToList(),
         TestResults = applicant.TestResults.Select(t => _truncatedTestMapper.Map(t)).ToList(),
         Suspended = applicant.Suspended
     };
 }
 public ApplicantForSpeciality Map(Applicant applicant, int subject1Id, int subject2Id, int subject3Id)
 {
     return new ApplicantForSpeciality
     {
         Banned = applicant.Banned,
         Birthdate = applicant.Birthdate,
         Id = applicant.Id,
         Image = applicant.Image,
         Name = applicant.Name,
         Sex = applicant.Sex,
         Surname = applicant.Surname,
         UserName = applicant.UserName,
         PhoneNumber = applicant.PhoneNumber,
         Suspended = applicant.Suspended,
         Result1 = applicant.TestResults.Where(t => t.SubjectId == subject1Id && t.ApplicantId ==applicant.Id).Select(t => t.Points).SingleOrDefault(),
         Result2 = applicant.TestResults.Where(t => t.SubjectId == subject2Id && t.ApplicantId ==applicant.Id).Select(t => t.Points).SingleOrDefault(),
         Result3 = applicant.TestResults.Where(t => t.SubjectId == subject3Id && t.ApplicantId ==applicant.Id).Select(t => t.Points).SingleOrDefault()
     };
 }