tag:blogger.com,1999:blog-2157078164517103759.post8218680070566661880..comments2023-07-31T03:31:57.774-07:00Comments on A Static State: Deep Dive into Custom RIA Service and TransactionsJason Apergishttp://www.blogger.com/profile/01817509015412502702noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-2157078164517103759.post-14696783343063392772010-07-02T14:27:39.643-07:002010-07-02T14:27:39.643-07:00Michael,
If you are getting an error sayinig &quo...Michael,<br /><br />If you are getting an error sayinig "entity has multiple parents" it sounds like something is messed up with the way you have created your associations.<br /><br />Can you explain to me what you are doing in your code that raises this expection? Is it raised when you try to add an object into the context or when you try to commit data in the context?<br /><br /><br />JasonJason Apergishttps://www.blogger.com/profile/01817509015412502702noreply@blogger.comtag:blogger.com,1999:blog-2157078164517103759.post-36809478674823631742010-07-02T10:37:54.688-07:002010-07-02T10:37:54.688-07:00Jason,
I came across this blog post searching for...Jason,<br /><br />I came across this blog post searching for the "entity has multiple parents" error. I am wondering what version of RIA Services you tested your code with. The reason I ask, is that using the RTM bits and a configuration nearly identical to yours, I can't seem to escape the error. The client classes generated by RIA Services ensure that when the association class properties are assigned parent entities (in your case employee and project), the association object is added to the collection classes on those entities. The explicit .Add operations you have in your code are redundant and have no effect. Removing the association object from either of the collections also automatically sets the corresponding <b>association object</b> property to null. Have you experienced this as well? Is there something in your code I am missing?<br /><br />Thank you!<br />-MichaelUnknownhttps://www.blogger.com/profile/04707454118786861607noreply@blogger.com