Open
Description
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Package Version
v2.9.8
Diagnostic ID
Repro steps
- In EF Core model configuration, define seed data for an entity using
builder.Entity<MyEntity>().HasData(new MyEntity { ... }, new MyEntity { ... } ... )
- Generate a new migration (
dotnet ef migrations add
)
Expected behavior
No warning
Actual behavior
Warning CA1814 on the argument for values
:
migrationBuilder.InsertData(
table: "MyEntity",
columns: new[] { "Id", "Name" },
values: new object[,]
{
{ 1, "Foo" },
{ 2, "Bar" }
});
InsertData
is a method from EF Core, I don't control it. I can't do anything about its signature, so the warning is useless in this case ; the only way to "fix" it would be to not call this method...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment