From 7cae86e577e7d8ada6a6ef62309c6fb040fc784c Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Tue, 9 Jan 2024 15:06:48 +0700 Subject: [PATCH] =?UTF-8?q?fix=20bug=20=E0=B9=81=E0=B8=81=E0=B9=89?= =?UTF-8?q?=E0=B9=84=E0=B8=82=E0=B9=83=E0=B8=9A=E0=B8=A5=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Leaves/LeaveRequests/LeaveRequestRepository.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs index 6002d069..51a0b868 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs @@ -69,6 +69,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests { var data = await _dbContext.Set().AsQueryable() .Include(x => x.LeaveDocument) + .ThenInclude(x => x.Document) .Include(x => x.LeaveDraftDocument) .Include(x => x.LeaveCancelDocument) .Include(x => x.Type) @@ -85,8 +86,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests if (entity.LeaveDraftDocument != null) _dbContext.Attatch(entity.LeaveDraftDocument); - if (entity.LeaveDocument != null) - _dbContext.Attatch(entity.LeaveDocument); + // if (entity.LeaveDocument != null) + // _dbContext.Attatch(entity.LeaveDocument); if (entity.Type != null) _dbContext.Attatch(entity.Type); @@ -102,8 +103,8 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests if (entity.LeaveDraftDocument != null) _dbContext.Attatch(entity.LeaveDraftDocument); - if (entity.LeaveDocument != null) - _dbContext.Attatch(entity.LeaveDocument); + // if (entity.LeaveDocument != null) + // _dbContext.Attatch(entity.LeaveDocument); if (entity.Type != null) _dbContext.Attatch(entity.Type);