From d8834793b5135b5f7c9d21648db10a8ca045ce91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Tom=C3=A9?= <108268980+r-tome@users.noreply.github.com> Date: Mon, 21 Nov 2022 14:25:28 +0000 Subject: [PATCH] Revert change on EF CipherRepository (#2426) --- .../Repositories/CipherRepository.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure.EntityFramework/Repositories/CipherRepository.cs b/src/Infrastructure.EntityFramework/Repositories/CipherRepository.cs index 6f81e5952f..c3268aa3fb 100644 --- a/src/Infrastructure.EntityFramework/Repositories/CipherRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/CipherRepository.cs @@ -562,7 +562,8 @@ public class CipherRepository : Repository, var attachments = string.IsNullOrWhiteSpace(cipher.Attachments) ? new Dictionary() : JsonConvert.DeserializeObject>(cipher.Attachments); - attachments.Add(attachment.AttachmentId, JsonConvert.DeserializeObject(attachment.AttachmentData)); + var metaData = JsonConvert.DeserializeObject(attachment.AttachmentData); + attachments[attachment.AttachmentId] = metaData; cipher.Attachments = JsonConvert.SerializeObject(attachments); await dbContext.SaveChangesAsync();