From dc56dead8fc163a56d713ff0aeb71029644c9e8d Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 16 Jul 2026 12:43:49 +0700 Subject: [PATCH] Silence compiler warning about AddRangeAsync The dotnet compiler warns that we should use AddRangeAsync here, but the EF Core documentation expicitly says that AddRangeAsync is only for use in special value generators, and all other uses should use AddRange. So we silence the compiler warning and still use AddRange. --- backend/FwLite/LcmCrdt/Data/LocalCommentReadStatusService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/FwLite/LcmCrdt/Data/LocalCommentReadStatusService.cs b/backend/FwLite/LcmCrdt/Data/LocalCommentReadStatusService.cs index dd5a200b1b..220dac1868 100644 --- a/backend/FwLite/LcmCrdt/Data/LocalCommentReadStatusService.cs +++ b/backend/FwLite/LcmCrdt/Data/LocalCommentReadStatusService.cs @@ -93,7 +93,10 @@ public async Task MarkCommentsUnread(IEnumerable<(Guid CommentId, Guid CommentTh .ToArray(); if (toInsert.Length == 0) return; + // AddRangeAsync says it exists only for use in special value generators, and all other uses should call AddRange +#pragma warning disable VSTHRD103 // Call async methods when in an async method dbContext.UnreadComments.AddRange(toInsert); +#pragma warning restore VSTHRD103 // Call async methods when in an async method try { await dbContext.SaveChangesAsync();