Skip to content

[release/3.1] RevEng: Don't create navigations to keyless entity types #19919

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 15, 2020
Merged

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Feb 13, 2020

Fixes #18633

Description

In 3.0, we started reverse engineering entity types for tables without a primary key. If the keyless table contained a foreign key, a bi-directional relationship was created for it; however navigation properties to a keyless entity type aren't allowed at runtime.

Customer Impact

The code generated by dotnet ef dbcontext scaffold throws at runtime and needs to be updated manually before it will work.

How found

Reported by multiple customers.

Test coverage

Automated tests were added covering the various scenarios reported.

Regression?

No.

Risk

Low. Navigation properties to the keyless entity type are no longer created. An AppContext switch was added to enable reverting to the previous behavior.

@bricelam bricelam added this to the 3.1.x milestone Feb 13, 2020
@ajcvickers
Copy link
Contributor

@bricelam Approved by Tactics and branches are open; let's try to get this merged today.

@bricelam bricelam merged commit 15f27c2 into dotnet:release/3.1 Feb 15, 2020
@bricelam bricelam deleted the ref branch February 15, 2020 20:36
@ajcvickers ajcvickers removed this from the 3.1.3 milestone Feb 15, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants