-
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
[Required]/IsRequired() on properties of owned entities is ignored #16943
Comments
@smitpatel please read both issues carefully, I'm not using table splitting. |
The issue has been discussed in detail in #16552 |
@ajcvickers this is pretty frustrating experience when a bot-like user with no real code on GitHub shuts down your bug reports, you spent hours to polish, by creating demonstrable samples. I just want to understand how can we get the same functionality we had on 2.2.6 when If there is not way to revert new behavior, then it's a bug/regression |
@ajcvickers @AndriySvyryd will I be able to restore 2.2.6 behavior with #15607 implemented and by marking owned property itself as |
I'm having the same issue with IsRequired() being ignored for owned type properties. Cheers |
@StefanSimion |
@StefanSimion @Mike-Wazowski there is not solution, unfortunately for now EF Core team is busy breaking things right before stable releases, by committing controversial stuff |
I really need this functionality back. (or a workaround for now) |
@davidhenley If you need the column to not be nullable you can modify the generated migration. |
Everyone that needs this functionality please vote (:+1:) for #12100 |
Why this issue was closed, since still not working at efcore 5.0.8? |
@ftathiago It is closed because it is a duplicate of #12100. This is fixed in 5.0. If you are seeing otherwise, then please open a new issues and attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate. |
In previous stable EF Core version (2.2.6) required properties of owned entities were marked as not null-able in the migration code. With .NET Core 3.0.0 preview 7 (6, 5 and probably previous versions too) they are marked as null-able (
nullable: true
).My tests in this solution demonstrate it.
Steps to reproduce
Please take a look
OwnedEntityRequired
project in this solution andInMemoryTests.OwnedEntityRequired()
xUnit test.migration on EF Core 2.2.6
migration on EF Core 3.0.0 preview 7
Further technical details
EF Core version: 3.0.0-preview7.19362.6
Database Provider: any (InMemory cannot be used for test, because it ignores
IsRequired()
)Operating system: any
IDE: Visual Studio 2019 16.2
The text was updated successfully, but these errors were encountered: