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

Fix for the optimizer when an entity has a collection property that references itself. #27397

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

AndriySvyryd
Copy link
Member

Fixes #27301

Port of #27350

Description

The code that ensures all the needed namespaces have been added recurses into generic collections, but didn't have a check for types that implent a collection of themselves.

Customer impact

Using dotnet ef dbcontext optimize will hang without any error messages for affected models.

How found

Reported by a customer on 6.0

Regression

No. Compiled models is a new feature in 6.0

Testing

Added a test for the affected scenario.

Risk

Low. The fix is very straightforward and localized. Also, only design-time tooling is affected.

…eferences itself.

Fixes #27301
# Conflicts:
#	src/EFCore.Design/Scaffolding/Internal/CSharpRuntimeModelCodeGenerator.cs
@AndriySvyryd AndriySvyryd requested a review from a team February 7, 2022 18:43
@AndriySvyryd AndriySvyryd added this to the 6.0.x milestone Feb 7, 2022
@AndriySvyryd AndriySvyryd changed the title Fix for the optimizer when an entity has a collection property that references itself. [release/6.0] Fix for the optimizer when an entity has a collection property that references itself. Feb 7, 2022
@AndriySvyryd AndriySvyryd modified the milestones: 6.0.x, 6.0.3 Feb 7, 2022
@AndriySvyryd
Copy link
Member Author

@dotnet/efteam Ping

@AndriySvyryd AndriySvyryd changed the title [release/6.0] Fix for the optimizer when an entity has a collection property that references itself. Fix for the optimizer when an entity has a collection property that references itself. Feb 8, 2022
@AndriySvyryd AndriySvyryd merged commit 8588082 into release/6.0 Feb 8, 2022
@AndriySvyryd AndriySvyryd deleted the Issue27301 branch February 8, 2022 19:54
@smitpatel smitpatel removed this from the 6.0.3 milestone Feb 9, 2022
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.

3 participants