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

[release/8.0] Treat required owned entities on derived types as optional. #31950

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

AndriySvyryd
Copy link
Member

Port of #31949
Fixes #31107

Description

When an owned entity type is required, we assume that it will be present even when selecting the base type.

Customer impact

For models with matching shape the queries that involve the base type of the type containing the required owned type with throw an exception.

How found

Customer reported on 7.0

Regression

Yes.

Testing

Added tests.

Risk

Low. Quirked.

@@ -25,6 +25,9 @@ namespace Microsoft.EntityFrameworkCore.Query.SqlExpressions;
public sealed partial class SelectExpression : TableExpressionBase
{
private const string DiscriminatorColumnAlias = "Discriminator";
private static readonly bool UseOldBehavior31107 =
Copy link
Contributor

Choose a reason for hiding this comment

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

are we doing quirks for 8.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can't hurt to reduce risk.

@AndriySvyryd AndriySvyryd merged commit f4484e8 into release/8.0 Oct 4, 2023
7 checks passed
@AndriySvyryd AndriySvyryd deleted the Issue31107_8 branch October 4, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update from ef 6 to ef 7. Error getting base type entities where one child has a required navigation property
2 participants