KEMBAR78
Update handling for bools and enums with database defaults by ajcvickers · Pull Request #30843 · dotnet/efcore · GitHub
Skip to content

Conversation

@ajcvickers
Copy link
Contributor

Fixes #15070

  • Warn for enums like we do for bools
  • Don't warn if a sentinel value has been configured
  • Update warning message to mention sentinel value
  • Set the sentinel by convention for non-nullable bools with a default value

@ajcvickers ajcvickers requested a review from a team May 8, 2023 12:09
== typeof(bool)
&& Equals(true, property.GetDefaultValue()))
{
propertyBuilder.HasSentinel(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should only set the sentinel when annotation is not null and reset it when it is.

ajcvickers added 3 commits May 9, 2023 09:09
Fixes #15070

- Warn for enums like we do for bools
- Don't warn if a sentinel value has been configured
- Update warning message to mention sentinel value
- Set the sentinel by convention for non-nullable bools with a default value
@ajcvickers ajcvickers force-pushed the TrueIsFalseAndFalseIsTrue0506 branch from c7dcdfa to f9bafb9 Compare May 9, 2023 08:28
@ajcvickers ajcvickers merged commit c63634b into main May 9, 2023
@ajcvickers ajcvickers deleted the TrueIsFalseAndFalseIsTrue0506 branch May 9, 2023 09:57
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.

Update handling of non-nullable store-generated properties

2 participants