Skip to content

[release/8.0] Don't throw when attempting to load from a newly Added entity with unknown FK values#32368

Merged
ajcvickers merged 2 commits into
release/8.0from
231120_MincePies
Nov 21, 2023
Merged

[release/8.0] Don't throw when attempting to load from a newly Added entity with unknown FK values#32368
ajcvickers merged 2 commits into
release/8.0from
231120_MincePies

Conversation

@ajcvickers

Copy link
Copy Markdown
Contributor

Port of #32343
Fixes #32314

Description

EF8 contains a new feature allowing lazy-loading from detached entities. This brought up a case where lazy-loading would be wrong because shadow FK values are not known. We throw an exception for this case in EF8, but this regressed a valid scenario where the key values are not known because the entity instance is new.

Customer impact

Exception when accessing a lazy-loading enabled navigation backed by a shadow foreign key on an entity in the Added state.

How found

Customer reported on 8.0

Regression

Yes

Testing

Added regression test.

Risk

Low and quirked.

@ajcvickers
ajcvickers requested a review from a team November 20, 2023 20:15
@ajcvickers ajcvickers added this to the 8.0.x milestone Nov 20, 2023
@ajcvickers
ajcvickers merged commit 0386645 into release/8.0 Nov 21, 2023
@ajcvickers
ajcvickers deleted the 231120_MincePies branch November 21, 2023 19:23
@ajcvickers ajcvickers removed this from the 8.0.x milestone Nov 21, 2023
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.

2 participants