修改
continuous-integration/drone/push Build is passing Details

Test_IRC_Net8
he 2025-03-17 16:44:43 +08:00
parent ae38c84ef7
commit 9e4cf1d1db
1 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ namespace IRaCIS.Core.Application.Service
if (!attachment.Path.Contains(attachment.DoctorId.ToString()))
{
var attachmentData= await _attachmentrepository.FirstOrDefaultAsync(a => a.Id == attachment.Id);
var attachmentData= await _attachmentrepository.Where(a => a.Id == attachment.Id).FirstNotNullAsync();
var fileName= attachmentData.Path.Split("/").Last();
@ -228,7 +228,7 @@ namespace IRaCIS.Core.Application.Service
if (attachment.DoctorId != null)
{
await _attachmentrepository.DeleteFromQueryAsync(a => a.DoctorId == attachment.DoctorId && a.Type == attachment.Type);
await _attachmentrepository.DeleteFromQueryAsync(a =>a.Id!=attachment.Id&& a.DoctorId == attachment.DoctorId && a.Type == attachment.Type);
}
attachment.UpdateTime = DateTime.Now;