-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Implement change tracking proxies #10949
Comments
I'd like to give this a go if that's not a problem. Is this on any existing roadmaps? I can write up a plan here and I'll probably have a couple simple questions before I start anything. |
@orionstudt This isn't currently planned for an upcoming release; a good PR is certainly something we would be interested in. Writing a plan here would be a good place to start. |
@ajcvickers Alright, cool. Here is my initial thoughts/plan:
Questions:
|
@orionstudt Thanks--this seems like a well thought out approach, and generally in the correct direction. I will discuss your questions with the team and get back to you. |
I will start this probably over the holiday or shortly thereafter and get something together for you guys to review. Happy holidays! |
@orionstudt Sounds good. |
@ajcvickers Made an initial draft PR with the current state of the work and copied the questions over there as I figured that might be a better place for any discussion. |
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.
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.
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.
Hi @orionstudt and @ajcvickers , I'm updating my book Entity Framework Core in Action to EF Core 5 and I will soon updating the part about INotifyPropertyChanged. Can you point me to an classes/unit tests that use this feature so I can understand it. No rush. |
Hi @JonPSmith. All the code for this feature is in the Specifically most of the code is in: |
@JonPSmith See also ProxyGraphUpdatesTestBaseOneToOne and related, and also ManyToManyTrackingProxySqlServerTest |
Hi @orionstudt and @ajcvickers , That should keep me busy. I will work though this and maybe get you to check that I have understand it correctly. |
Hi @orionstudt and @ajcvickers , I am writing about change tracking proxies. What I have worked out so far are:
Things I don't understand are
Questions I have
|
I'm not sure I'm understanding this question correctly but, the
That is correct. This was a design decision from the EFCore team. @ajcvickers discussed this here & here.
Yes this should absolutely be ok. You can see in Hope that helps. |
Hi @orionstudt, Thanks for coming back to me. I have worked it out now:
That what works in my unit test but is that what you recommend? The use of the It also looks like you can't have a Thanks for the other answers. They all make sense. |
@JonPSmith To add to what @orionstudt said, this is the case where I wouldn't expect to set different values for I filed #21920 |
Using the lazy-loading proxy infrastructure coupled with INotifyPropertyChanging and INotifyPropertyChanged.
Also, consider partial notifications, for example to detect setting a navigation property or FK to null--see this discussion: dotnet/ef6#452
The text was updated successfully, but these errors were encountered: