@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user