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

Warn for non-nullable store-generated bool properties #7163

Closed
ajcvickers opened this issue Nov 30, 2016 · 1 comment
Closed

Warn for non-nullable store-generated bool properties #7163

ajcvickers opened this issue Nov 30, 2016 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@ajcvickers
Copy link
Member

For bool properties the only valid values are true and false. If the value is false, then it is the CLR default, which triggers store generation. Therefore it is impossible to insert false values. This is unlikely to be the desired behavior. The usual fix for this is to make the property nullable.

For enums the situation is slightly different. The CLR default is always zero, which might also be a defined enum value, but also might not be. Even if it is a valid enum value it might be defined as something like "Default" possibly indicating that value generation should happen.

@rowanmiller rowanmiller added this to the 1.2.0 milestone Nov 30, 2016
@ajcvickers
Copy link
Member Author

Triage decision: warn only for bools.

@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Apr 19, 2017
@ajcvickers ajcvickers changed the title Warn for non-nullable store-generated bool/enum properties Warn for non-nullable store-generated bool properties May 31, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview2, 2.0.0 May 31, 2017
@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 May 31, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview2, 2.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

2 participants