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

3.1.x: Disable NRTs in scaffolding (replaced) #23053

Closed
wants to merge 1 commit into from

Conversation

roji
Copy link
Member

@roji roji commented Oct 19, 2020

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.

@roji roji changed the title Disable NRTs in scaffolding (#21190) 3.1.x: Disable NRTs in scaffolding (#21190) Oct 19, 2020
@roji roji changed the base branch from main to release/3.1 October 19, 2020 22:46
@ajcvickers ajcvickers added this to the 3.1.x milestone Oct 19, 2020
@ajcvickers ajcvickers requested a review from a team October 19, 2020 23:27
@roji
Copy link
Member Author

roji commented Oct 20, 2020

Any idea how to restart the weirdly-cancelled Helix build? I'm not finding a re-run button :/

@roji roji linked an issue Oct 20, 2020 that may be closed by this pull request
@roji roji changed the title 3.1.x: Disable NRTs in scaffolding (#21190) 3.1.x: Disable NRTs in scaffolding Oct 20, 2020
@roji roji linked an issue Oct 20, 2020 that may be closed by this pull request
@smitpatel smitpatel closed this Oct 20, 2020
@smitpatel smitpatel reopened this Oct 20, 2020
@smitpatel
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@smitpatel
Copy link
Member

You are out of luck unless you create a new PR

@roji roji closed this Oct 20, 2020
@roji roji reopened this Oct 20, 2020
Part of #15520

(cherry picked from commit 0b50d83)
@roji
Copy link
Member Author

roji commented Oct 20, 2020

😢

Replaced by #23060

@roji roji changed the title 3.1.x: Disable NRTs in scaffolding 3.1.x: Disable NRTs in scaffolding (replaced) Oct 20, 2020
@roji roji removed this from the 3.1.x milestone Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants