You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migration tool Add-Migration generates code for adding a nullable column for non-nullable properties inside owned types
Steps to reproduce
1.- C# 8 nullable checks are on
2.- Add a non-nullable property to an Owned type
3.- Run Add-Migration
4.- nullable: true code is generated
classMyEntity{[Key]publicintId{get;set;}//This property is correctly generated (non nullable)publicboolMyProp{get;set;}publicMyOwnedTypeOwnedType{get;set;}=newMyOwnedType();}[Owned]classMyOwnedType{//This property is generated as a nullable column (wrong)publicboolOwnedProp{get;set;}}
Migration tool
Add-Migration
generates code for adding a nullable column for non-nullable properties inside owned typesSteps to reproduce
1.- C# 8 nullable checks are on
2.- Add a non-nullable property to an
Owned
type3.- Run
Add-Migration
4.-
nullable: true
code is generatedGenerated code:
Further technical details
EF Core version: 3.0.0
Database provider: Microsoft.EntityFrameworkCore.SqlServer 3.0.0
Target framework: netcoreapp3
Operating system: Windows 10
Visual Studio 2019 16.3.7
The text was updated successfully, but these errors were encountered: