ต่อ Api period exam

This commit is contained in:
AnandaTon 2023-03-30 15:07:35 +07:00
parent 338322986e
commit 8d64f8bb4a
2 changed files with 52 additions and 0 deletions

View file

@ -143,6 +143,33 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
}
}
public async Task<CandidateInformationResponseItem?> GetsAsyncInformation(string candidateId)
{
return await _context.Candidates.AsQueryable()
.Where(x => x.Id == Guid.Parse(candidateId))
.Select(x => new CandidateInformationResponseItem
{
Prefix = x.Prefix,
PrefixId = x.Prefix != null ? x.Prefix.Id.ToString() : null,
FirstName = x.FirstName,
LastName = x.LastName,
Nationality = x.Nationality,
DateOfBirth = x.DateOfBirth,
Relationship = x.Relationship,
RelationshipId = x.Relationship != null ? x.Relationship.Id.ToString() : null,
CitizenProvince = x.CitizenProvince,
CitizenProvinceId = x.CitizenProvince != null ? x.CitizenProvince.Id.ToString() : null,
CitizenDistrict = x.CitizenDistrict,
CitizenDistrictId = x.CitizenDistrict != null ? x.CitizenDistrict.Id.ToString() : null,
CitizenDate = x.CitizenDate,
Email = x.Email,
CitizenId = x.CitizenId,
Telephone = x.Telephone,
MobilePhone = x.MobilePhone,
Knowledge = x.Knowledge,
})
.FirstOrDefaultAsync();
}
#endregion
}
}