-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Nullable property is required if there is another not-nullable string property in model #16760
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Comments
SonicGD
changed the title
Nullable reference property is required if there is another not-nullable string poperty in model
Nullable property is required if there is another not-nullable string poperty in model
Jul 26, 2019
SonicGD
changed the title
Nullable property is required if there is another not-nullable string poperty in model
Nullable property is required if there is another not-nullable string property in model
Jul 26, 2019
@roji Looks like our first bug with nullable reference types! |
@SonicGD thanks for reporting! Your sample indeed exposed some bugs in the nullability handling, have submitted a PR with the fixes. Hopefully you can continue testing with the preview8 nightlies once that's merged! |
roji
added a commit
that referenced
this issue
Jul 26, 2019
roji
added
the
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
label
Jul 26, 2019
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.
customer-reported
type-bug
Hello. After i upgraded to preview7 from preview5 some of my queries started to throw exceptions cause of null values in database for nullable properties. I reproduced this in test project and there is something strange. I have
Nullable reference types
enabled.Steps to reproduce
Define model class
Now generate migration:
Property
EmptyId
hasnullable: true
as it should.Now let's create another model with additional sting property
and generate new migration
Here property
EmptyId
hasnullable: false
for some reasons.If we change
SomeString
to nullable stringthen both properties are correctly nullable:
and if we move
EmptyId
to base class:it will be nullable:
Further technical details
EF Core version: 3.0.0-preview7.19362.6
Database Provider: Microsoft.EntityFrameworkCore.SqlServer and Npgsql.EntityFrameworkCore.PostgreSQL
Operating system: Windows 10 18941
IDE: dotnet cli
The text was updated successfully, but these errors were encountered: