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

Stop keeping a reference to the model in LazyLoader instances and the Castle interceptor #32388

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

ajcvickers
Copy link
Member

Fixes #32348

@ajcvickers ajcvickers requested a review from a team November 22, 2023 11:48
private ILazyLoader? _loader;
private readonly Dictionary<string, bool> _navigations;
Copy link
Member

Choose a reason for hiding this comment

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

You can use HashSet for both of these, just don't store the navigations that don't match the criteria.

Copy link
Member Author

Choose a reason for hiding this comment

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

We actually use both pieces of information--is this a navigation (as opposed to some other property or a nonsense string) and whether or not is it enabled for lazy-loading.

@ajcvickers ajcvickers merged commit 84505e3 into main Nov 23, 2023
7 checks passed
@ajcvickers ajcvickers deleted the 231121_SwiperNoSwiping branch November 23, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LazyLoader retains references to the EF model after it has been detatched/disposed
2 participants