Enable nullability in migrations and model snapshots

Open
#18,950 12 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
database

Research direction

Start with the generated migration files and model snapshots from an ASP.NET Core 3.0 application with nullable reference types enabled. Inspect the "new object[]" declarations producing CS8625 warnings, then verify that generated migrations and snapshots no longer require a global nullable-warning suppression while nullable analysis remains enabled.

Written by the indexing model from the issue text.

Description

area-migrations customer-reported propose-close

I am generating migrations files for EF core with the new nullable reference types analysis turned on for an ASP.NET core app (3.0).

The migration file generated has several "new object[]" declarations that VS is flagging for CS8625 warnings (screenshot included).

image

Is there a work-around or change coming so that we don't have to do a global suppression. I want the nullable reference analysis, but just not for these migration files.

Dominant language
C#
Stars
14.8k
Forks
3.4k
Avg merge
2d 5h
Merged PRs (30d)
134

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/efcore

All issues in dotnet/efcore

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.