From 39da79a8934c160759543f4016f925463f28df73 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 11 Jul 2025 12:07:50 +0700 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20=E0=B8=AA=E0=B8=A1=E0=B8=B1?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=AA=E0=B8=AD=E0=B8=9A=E0=B9=80=E0=B8=9E?= =?UTF-8?q?=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B8=A3=E0=B8=B9=E0=B8=9B=E0=B9=82?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B9=84=E0=B8=9F=E0=B8=A5=E0=B9=8C=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=9A=E0=B8=9A=E0=B9=81=E0=B8=88=E0=B9=89=E0=B8=87?= =?UTF-8?q?=20Error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/CandidateService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Services/CandidateService.cs b/Services/CandidateService.cs index ae41bb6..17ec119 100644 --- a/Services/CandidateService.cs +++ b/Services/CandidateService.cs @@ -1259,9 +1259,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (candidate == null) throw new Exception(GlobalMessages.ExamNotFound); - string profileImgId = candidate.ProfileImg.Id.ToString(); if (candidate.ProfileImg != null) { + string profileImgId = candidate.ProfileImg.Id.ToString(); //ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo candidate.ProfileImg = null; await _context.SaveChangesAsync(); @@ -1286,9 +1286,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Services if (candidate == null) throw new Exception(GlobalMessages.ExamNotFound); - string profileImgId = candidate.ProfileImg.Id.ToString(); if (candidate.ProfileImg != null) { + string profileImgId = candidate.ProfileImg.Id.ToString(); //ลบ FK ในเบสก่อนแล้วค่อยไปลบที่ minIo candidate.ProfileImg = null; await _context.SaveChangesAsync();