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

Graph update tests for change tracking proxies #19706

Merged
merged 1 commit into from
Jan 26, 2020

Conversation

ajcvickers
Copy link
Member

Issue #10949

Found and fixed a couple of bugs:

  • Proxies were reading directly from the property. This can cause recursive loops in some cases. Fixed by using EF's compiled delegates for writing to the field directly.
  • Comparisons were being done by the default for the property/navigation. Instead force use of configured value comparer for regular properties or reference equality for navigations.

Also added overloads to CreateProxy to make it easier to do creation of proxy graphs inline.

@ajcvickers
Copy link
Member Author

@orionstudt Would appreciate a quick review if you can!

@ajcvickers ajcvickers requested a review from a team January 25, 2020 18:30
@orionstudt
Copy link
Contributor

orionstudt commented Jan 25, 2020

@ajcvickers Oh damn! Looks like some intricacies in the value comparison that I missed not being as knowledgeable in EF as you, but it makes sense looking at it. I think the resulting interceptor code is a bit cleaner too. Looks good to me.

The CreateProxy overload is a nice QOL improvement.

Edit: I now see what you meant when you mentioned the ProxyGraph tests during the PR. For some reason I hadn't realized that that would need to be updated as well - and I'm not sure I would've known how to go about that lol so I'm glad you got to it.

@ajcvickers
Copy link
Member Author

@orionstudt Thanks. These are things that are easy to miss--I reviewed the code and missed them!

Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

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

Consider adding ownership tests as well.

@ajcvickers
Copy link
Member Author

@AndriySvyryd Covered by #16454

Issue #10949

Found and fixed a couple of bugs:
* Proxies were reading directly from the property. This can cause recursive loops in some cases. Fixed by using EF's compiled delegates for writing to the field directly.
* Comparisons were being done by the default for the property/navigation. Instead force use of configured value comparer for regular properties or reference equality for navigations.

Also added overloads to `CreateProxy` to make it easier to do creation of proxy graphs inline.
@AndriySvyryd
Copy link
Member

Touché

@ajcvickers ajcvickers merged commit 70288d2 into master Jan 26, 2020
@ajcvickers ajcvickers deleted the ChangeTrackingProxies0119 branch January 26, 2020 21:21
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.

3 participants