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

Consider utilizing "local" detect changes #13552

Closed
ajcvickers opened this issue Oct 9, 2018 · 1 comment
Closed

Consider utilizing "local" detect changes #13552

ajcvickers opened this issue Oct 9, 2018 · 1 comment
Assignees
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@ajcvickers
Copy link
Member

That is, DetectChanges that only scan a single entry, or possibly only the entries on either side of a given relationship. This may miss cascading changes, but it is likely to avoid the need for full DetectChanges in many scenarios. For example, see #13122 and #12810.

@yileicn
Copy link

yileicn commented Jan 9, 2019

SaveChange () is already called DetectChanges(), so you don't need to call here?
Now call DbContext. Entry () very slowly

ajcvickers added a commit that referenced this issue Feb 7, 2019
Issue #13552

It will DetectChanges in the current entry and any tracked principals. This ensures that any cascading operations are detected. Dependents are not checked eagerly, but if a Member/Reference/Collection method is called to get related dependent entities, then local DetectChanges is run on the related dependents. These two things eliminated any breaks in our functional tests.

Also, Lazy-loading now does a local DetectChanges, which means FK changes will be picked up and honored by the loader.
ajcvickers added a commit that referenced this issue Feb 8, 2019
Issue #13552

It will DetectChanges in the current entry and any tracked principals. This ensures that any cascading operations are detected. Dependents are not checked eagerly, but if a Member/Reference/Collection method is called to get related dependent entities, then local DetectChanges is run on the related dependents. These two things eliminated any breaks in our functional tests.

Also, Lazy-loading now does a local DetectChanges, which means FK changes will be picked up and honored by the loader.
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Feb 8, 2019
ajcvickers added a commit that referenced this issue Feb 8, 2019
Issue #13552

It will DetectChanges in the current entry and any tracked principals. This ensures that any cascading operations are detected. Dependents are not checked eagerly, but if a Member/Reference/Collection method is called to get related dependent entities, then local DetectChanges is run on the related dependents. These two things eliminated any breaks in our functional tests.

Also, Lazy-loading now does a local DetectChanges, which means FK changes will be picked up and honored by the loader.
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview3 Feb 22, 2019
@ajcvickers ajcvickers reopened this Feb 28, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview3, 3.0.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests

2 participants