-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
3.1.x: Disable NRTs in scaffolding (replaced) #23053
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bricelam
approved these changes
Oct 20, 2020
Any idea how to restart the weirdly-cancelled Helix build? I'm not finding a re-run button :/ |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
You are out of luck unless you create a new PR |
8092023
to
265bfb2
Compare
😢 Replaced by #23060 |
This was
unlinked from
issues
Oct 20, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original PR merged for 5.0: #21190
This backports the fix for #23016 to 3.1.
Description
This adds
#nullable disable
at the top of all C# files generated by EF Core's scaffolding.Customer Impact
EF Core scaffolding is currently unaware of C# 8.0 Nullable Reference Types (NRT), and generates a code model without annotations. If the project has NRTs turned on, the model get incorrectly interpreted, i.e. nullable database text columns are represented by
string SomeProperty
, which with NRTs is interpreted as non-nullable.How found
Reported by users (e.g. #23016). The issue for adding fully supporting NRTs, i.e. correctly scaffolding code with annotations (#15520) also has 28 votes, giving reason to believe many users are running into this.
Test coverage
This PR includes testing that the
#nullable disable
actually gets scaffolded.Regression?
No.
Risk
Low. This touches scaffolding code only - which does not affect EF Core runtime behavior - and in a minor way.