dotnet / dotnet/EntityFramework.Docs
Document how to create an editor.config to suppress warnings in migrations files
- Dominant language
- Mermaid
- Stars
- 1.7k
- Forks
- 2k
- Avg merge
- 7d 23h
- Merged PRs (30d)
- 16
Description
The new CA1861 warning added in .net 8 preview 5 added a bunch of warnings to my existing solution, complaining about generated migrations files. Based on my understanding of the warning and how migrations are used, I don't think the recommendation makes sense in context.
For example this generated migration code:
```
migrationBuilder.CreateIndex(
name: "IX_MyTable_DbId_TypeId_SourceId",
table: "MyTable",
columns: new[] { "DbId", "TypeId", "SourceId" },
unique: true);
```
The `columns:` line triggers the warning.
I can suppress it for the full migrations folder with a `.editorconfig` no problem, but I think it would be nice if the migrations could handle this themselves during generation
It would be nice if generated migrations would suppress CA1861 to prevent build warnings in solutions containing migration files
Contributor guide
Assessment
This issue has not been assessed yet.