Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate EF Core for nullable reference types #19007

Closed
23 tasks done
Tracked by #43619
roji opened this issue Nov 21, 2019 · 12 comments · Fixed by #23133, #23126, #23147, #23938 or #23905
Closed
23 tasks done
Tracked by #43619

Annotate EF Core for nullable reference types #19007

roji opened this issue Nov 21, 2019 · 12 comments · Fixed by #23133, #23126, #23147, #23938 or #23905
Assignees
Labels
area-global closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement User Story A single user-facing feature. Can be grouped under an epic.
Projects
Milestone

Comments

@roji
Copy link
Member

roji commented Nov 21, 2019

Note: #14150 tracks introducing nullability to non-public parts as well (i.e. annotate the entire codebase), and isn't currently planned for 5.0.

This issue now tracks annotating the entire codebase for C# 8 NRTs.

/cc @rynowak @cartermp

Work status

  • Analyzers
  • Abstractions
  • Change tracking (@smitpatel)
  • Design (@bricelam)
  • Diagnostics
  • Extensions
  • Infrastructure
  • Internal
  • Metadata
  • Microsoft.Data.Sqlite
  • Migrations (@bricelam)
  • Proxies
  • Query (leftovers in Cosmos, @smitpatel)
  • Storage (leftovers in Cosmos, @roji)
  • Tools & cmdline (@bricelam)
  • Update (@roji)
  • ValueGeneration (@roji)

Some specific leftovers we need to do:

@roji roji added this to the 5.0.0 milestone Nov 21, 2019
@roji roji self-assigned this Nov 21, 2019
@ajcvickers
Copy link
Member

Consider specifically the scenario in #19443 when working on this.

@ajcvickers
Copy link
Member

Tag: C# nullable reference types

@roji
Copy link
Member Author

roji commented Jul 31, 2020

Note: for LINQ async operators (e.g. FirstOrDefaultAsync): dotnet/roslyn#45993 (but depends on C# 9)

roji added a commit that referenced this issue Oct 30, 2020
Annotates Model, Property, Navigation, Key, Index, and all their extensions.

Part of #19007
roji added a commit that referenced this issue Oct 31, 2020
Annotates Model, Property, Navigation, Key, Index, and all their extensions.

Part of #19007
roji added a commit that referenced this issue Oct 31, 2020
Annotates Model, Property, Navigation, Key, Index, and all their extensions.

Part of #19007
@ghost ghost closed this as completed in #23147 Oct 31, 2020
ghost pushed a commit that referenced this issue Oct 31, 2020
Annotates Model, Property, Navigation, Key, Index, and all their extensions.

Part of #19007
@smitpatel smitpatel reopened this Oct 31, 2020
@smitpatel
Copy link
Member

This is done?

bricelam added a commit to bricelam/efcore that referenced this issue Mar 9, 2021
bricelam added a commit to bricelam/efcore that referenced this issue Mar 9, 2021
@smitpatel smitpatel removed their assignment Mar 10, 2021
bricelam added a commit to bricelam/efcore that referenced this issue Mar 12, 2021
bricelam added a commit to bricelam/efcore that referenced this issue Mar 12, 2021
bricelam added a commit to bricelam/efcore that referenced this issue Mar 15, 2021
ghost pushed a commit that referenced this issue Mar 15, 2021
roji added a commit that referenced this issue Mar 15, 2021
* Enable nullability warnings as errors
* Remove all individual file #nullable enable

Part of #19007
@bricelam bricelam removed their assignment Mar 15, 2021
ghost pushed a commit that referenced this issue Mar 15, 2021
* Enable nullability warnings as errors
* Remove all individual file #nullable enable

Part of #19007
@davidkarlsson
Copy link

Not sure if this has been fixed already but I've ran across a rather strange error that might be easy to miss which I think is related to the ef core analyzer and nullability which causes CS8619 warnings. I reported the issue in the Roslyn repo (dotnet/roslyn#51886) because I didn't see that it was related to EF Core at first.

Basically if you create an anonymous type from a type that has nullable ref types with a lambda expression and you then also call an async ef method in a loop like FirstOrDefaultAsync() or SaveChangesAsync() in the same method you will get a CS8619 warning saying that the anonymous type doesn't match the expected type.

The same problem happens in both 5.0.4 and 6.0.0-preview.2.21154.2.

@roji
Copy link
Member Author

roji commented Mar 17, 2021

Split off annotating tests to #24427

@roji roji closed this as completed Mar 18, 2021
.NET 6.0 automation moved this from In Progress to Completed Mar 18, 2021
@roji roji assigned bricelam and smitpatel and unassigned maumar Mar 18, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0, 6.0.0-preview3 Mar 25, 2021
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 28, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0-preview3, 6.0.0 Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment