From 890c34e0d5c754a1e20e64cd346a7f7406f12664 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Sat, 2 Sep 2023 22:19:13 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B9=89=E0=B8=81=20=E0=B8=94=E0=B8=B6=E0=B8=87=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=A2=E0=B8=8A=E0=B8=B7=E0=B9=88=E0=B8=AD=20c-pm-1?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/Commands/CommandRepository.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs index 68fbf57d..136d5701 100644 --- a/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs +++ b/BMA.EHR.Application/Repositories/Commands/CommandRepository.cs @@ -718,7 +718,7 @@ namespace BMA.EHR.Application.Repositories.Commands var seq = 1; // เอาชื่อของกรรมการ ไปหาจากทะเบียนประวัติ - var p1 = await _dbContext.Set() + var p1 = (await _dbContext.Set() .Include(x => x.Prefix) .Select(x => new { @@ -729,7 +729,8 @@ namespace BMA.EHR.Application.Repositories.Commands lastName = x.LastName, fullName = $"{x.Prefix.Name}{x.FirstName} {x.LastName}" }) - .FirstOrDefaultAsync(x => x.fullName == command.ChairManFullName); + .ToListAsync()) + .FirstOrDefault(x => x.fullName == command.ChairManFullName); if (p1 != null) { @@ -746,7 +747,7 @@ namespace BMA.EHR.Application.Repositories.Commands result.Add(receiver); } - var p2 = await _dbContext.Set() + var p2 = (await _dbContext.Set() .Include(x => x.Prefix) .Select(x => new { @@ -757,7 +758,8 @@ namespace BMA.EHR.Application.Repositories.Commands lastName = x.LastName, fullName = $"{x.Prefix.Name}{x.FirstName} {x.LastName}" }) - .FirstOrDefaultAsync(x => x.fullName == command.Member1FullName); + .ToListAsync()) + .FirstOrDefault(x => x.fullName == command.Member1FullName); if (p2 != null) { @@ -774,7 +776,7 @@ namespace BMA.EHR.Application.Repositories.Commands result.Add(receiver); } - var p3 = await _dbContext.Set() + var p3 = (await _dbContext.Set() .Include(x => x.Prefix) .Select(x => new { @@ -785,7 +787,8 @@ namespace BMA.EHR.Application.Repositories.Commands lastName = x.LastName, fullName = $"{x.Prefix.Name}{x.FirstName} {x.LastName}" }) - .FirstOrDefaultAsync(x => x.fullName == command.Member2FullName); + .ToListAsync()) + .FirstOrDefault(x => x.fullName == command.Member2FullName); if (p3 != null) {