Bug description
EFCore AddRange method on dbsets incorrectly warns when using the params ...[] array overload.
If you create the collection in advance as a list, no issue. However if you create as an array,
Repro steps
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15" />
Any db context with a dbset.
Call AddRange with an array on the dbset.
Get warned about using AddRangeAsync instead (when you are not supposed to use AddRangeAsync unless you know you added async hooks to your dbcontext).
Expected behavior
No warning, or a way to tell the analyzer whether you use async hooks or not on your db context and have it be opt-in.
Actual behavior
Warning.
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15" />
- Application (if applicable):
Additional context
.NET 8.
<TargetFramework>net8.0</TargetFramework>
EFCore (and related) packages
<PackageVersion Include="LinqKit.Microsoft.EntityFrameworkCore" Version="8.1.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.13" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.6" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.13" />
Bug description
EFCore AddRange method on dbsets incorrectly warns when using the params ...[] array overload.
If you create the collection in advance as a list, no issue. However if you create as an array,
Repro steps
Expected behavior
No warning, or a way to tell the analyzer whether you use async hooks or not on your db context and have it be opt-in.
Actual behavior
Warning.
Additional context
.NET 8.
EFCore (and related) packages