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

NRTs are enabled by default in .NET 6 #3788

Closed
marcinjahn opened this issue Mar 29, 2022 · 2 comments · Fixed by #3790
Closed

NRTs are enabled by default in .NET 6 #3788

marcinjahn opened this issue Mar 29, 2022 · 2 comments · Fixed by #3790
Assignees
Milestone

Comments

@marcinjahn
Copy link

The page has the following excerpt regarding NRTs:

This feature is disabled by default, and affects EF Core's behavior in the following way:

The truth is that in .NET 6. NRTs are enabled by default, making that sentence false.

Addtional excerpts that should be changed:

If nullable reference types are disabled (the default)

The following example shows an entity type with required and optional properties, with the nullable reference feature disabled (the default) and enabled:

Please let me know if you want me to create a PR with appropriate changes.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@roji
Copy link
Member

roji commented Mar 29, 2022

The truth is that in .NET 6. NRTs are enabled by default, making that sentence false.

AFAIK you still have to opt into NRTs by setting <Nullable>enable</Nullable> in your csproj. The project templates have been modified to do that, but with existing csproj files that don't contain the property, NRTs stay disabled. We could still amend the text to be clearer.

@marcinjahn
Copy link
Author

marcinjahn commented Mar 29, 2022

Right, if you create a new project right now with .NET 6 SDK, you will have it enabled.

Well, I found the quoted bits a bit misleading and had a feeling that the information is outdated, but it's not something critical for sure.

roji added a commit to roji/EntityFramework.Docs that referenced this issue Mar 30, 2022
@roji roji added this to the 7.0.0 milestone Mar 30, 2022
@roji roji self-assigned this Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants