The following methods should be suppressed for the new rule csharpsquid:S6966 “Awaitable method should be used”:
DbContext.AddDbContext.AddRangeDbSet.AddDbSet.AddRange
See Don´t emit CA1849 when using DbSet.Add and DbSet.AddRange EntityFramework Methods by Spacefish · Pull Request #6858 · dotnet/roslyn-analyzers · GitHub for a similar fix for the Roslyn analyzer rule CA1849 “Call async methods when in an async method”.
- ALM used: Azure DevOps
- CI system used: Azure DevOps
- Scanner command used when applicable:
SonarCloudAnalyzeYAML task - Languages of the repository: C#
- Error observed: csharpsquid:S6966 “Awaitable method should be used” is reported for EF Core AddRange methods.
- Steps to reproduce: Add code that calls
DbContext.AddRange - Potential workaround: -