4 Replies
Let's say I have 2 dogs nicknamed "Teddy" and "Biscuit" who both have 1 owner, "John"
Ignoring the circular nature, this will create 2 separate Owner entities, one for each dog.
When I show 2 windows for each dog, bind on the owner and change the owners PhoneNumber for "Teddy", the window for "Biscuit" will still show the old owner's phone number.
My current method to avoid this is to get each Dog, each Relationship and each Owner separately, create the basic ViewModels (only strings/ints/etc, not other classes) and stitch these together afterwards.
This becomes quite annoying/prone to errors considering the amount of classes/relationships I have in my real project.
@Pope do you have any idea on how to approach this problem easier?
What data do you want to get? Dogs and their owners?
Select that on the query level, that way there's not gonna be any circular issues
that's not the problem, it's about mapping the retrieved entities to viewmodels, it's creating a new Owner object twice
Ah, right