-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGetAllPatientAsync.txt
More file actions
39 lines (33 loc) · 1.25 KB
/
Copy pathGetAllPatientAsync.txt
File metadata and controls
39 lines (33 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
public async Task<List<ResultPatientDto>> GetAllPatientsAsync()
{
var patients = await _context.Patients.ToListAsync();
var result = new List<ResultPatientDto>();
foreach (var patient in patients)
{
var identityUser = await _httpClient
.GetFromJsonAsync<IdentityUserDto>(
$"https://localhost:7001/api/users/{patient.AppUserId}");
var dto = new ResultPatientDto
{
PatientId = patient.PatientId,
AppUserId = patient.AppUserId,
TcKimlikNo = patient.TcKimlikNo,
InsuranceType = patient.InsuranceType,
CreatedDate = patient.CreatedDate,
Status = patient.Status,
Name = identityUser.Name,
Surname = identityUser.Surname,
FullName = $"{identityUser.Name} {identityUser.Surname}",
Email = identityUser.Email,
PhoneNumber = identityUser.PhoneNumber,
Gender = identityUser.Gender,
BirthDate = identityUser.BirthDate,
BloodGroup = identityUser.BloodGroup,
ImageUrl = identityUser.ImageUrl,
City = identityUser.City,
Address = identityUser.Address
};
result.Add(dto);
}
return result;
}