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

The naming convention of custom foreign keys and shadow attributes conflicts. Types that can be null cannot be null during migration #29452

Closed
zhuangState opened this issue Oct 29, 2022 · 3 comments · Fixed by #31780

Comments

@zhuangState
Copy link

zhuangState commented Oct 29, 2022

EFModel.zip

EF Core version 6.0.9
Migration result: AccountID = table.Column(type: "int", nullable: false)
image

@zhuangState
Copy link
Author

zhuangState commented Oct 29, 2022

I'm not sure if this is a feature
Because the following writing methods can get correct results
image
image
image

@ajcvickers
Copy link
Contributor

Related to #27859 and #27925.

@ajcvickers
Copy link
Contributor

Note from triage: when the foreign key property and navigation nullability conflict, then, in addition to warning (#27925), the foreign key nullability should take preference.

@ajcvickers ajcvickers added this to the 8.0.0 milestone Nov 4, 2022
AndriySvyryd added a commit that referenced this issue Sep 17, 2023
Annotating the navigation with [Required] will still override nullable properties.

Fixes #29452
Fixes #30227
@AndriySvyryd AndriySvyryd removed their assignment Sep 17, 2023
AndriySvyryd added a commit that referenced this issue Sep 18, 2023
…ity (#31780)

Annotating the navigation with [Required] will still override nullable properties.

Fixes #29452
Fixes #30227
@ajcvickers ajcvickers modified the milestones: 8.0.0, 8.0.0-rc2 Sep 18, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0-rc2, 8.0.0 Nov 14, 2023
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.

3 participants