{"action":"created","issue":{"url":"https://api.github.com/repos/Daniel-Svensson/test/issues/82","repository_url":"https://api.github.com/repos/Daniel-Svensson/test","labels_url":"https://api.github.com/repos/Daniel-Svensson/test/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/Daniel-Svensson/test/issues/82/comments","events_url":"https://api.github.com/repos/Daniel-Svensson/test/issues/82/events","html_url":"https://github.com/Daniel-Svensson/test/issues/82","id":272331155,"number":82,"title":"PropertyChanges are raised at the wrong time after successful SubmitChanges","user":{"login":"Daniel-Svensson","id":3167509,"avatar_url":"https://avatars1.githubusercontent.com/u/3167509?v=4","gravatar_id":"","url":"https://api.github.com/users/Daniel-Svensson","html_url":"https://github.com/Daniel-Svensson","followers_url":"https://api.github.com/users/Daniel-Svensson/followers","following_url":"https://api.github.com/users/Daniel-Svensson/following{/other_user}","gists_url":"https://api.github.com/users/Daniel-Svensson/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel-Svensson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel-Svensson/subscriptions","organizations_url":"https://api.github.com/users/Daniel-Svensson/orgs","repos_url":"https://api.github.com/users/Daniel-Svensson/repos","events_url":"https://api.github.com/users/Daniel-Svensson/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel-Svensson/received_events","type":"User","site_admin":false},"labels":[{"id":743491989,"url":"https://api.github.com/repos/Daniel-Svensson/test/labels/bug","name":"bug","color":"ee0701","default":true},{"id":743525045,"url":"https://api.github.com/repos/Daniel-Svensson/test/labels/Client","name":"Client","color":"ededed","default":false},{"id":743498427,"url":"https://api.github.com/repos/Daniel-Svensson/test/labels/CodePlexMigrationInitiated","name":"CodePlexMigrationInitiated","color":"ededed","default":false},{"id":743506694,"url":"https://api.github.com/repos/Daniel-Svensson/test/labels/Impact:%20Unassigned","name":"Impact: Unassigned","color":"ededed","default":false},{"id":744700897,"url":"https://api.github.com/repos/Daniel-Svensson/test/labels/Open%20RIA%20Services%204.4.1.x","name":"Open RIA Services 4.4.1.x","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-08T20:04:48Z","updated_at":"2017-11-08T20:05:44Z","closed_at":null,"author_association":"OWNER","body":"When inserting two related entities in the same commit PropertyChanged events are raised in an incorrect manner so that any observer using PropertyChange events to determine the values of an Entitiy's proeprties will get the wrong values and belive that navigation properties which are the same as before the submit instead has changed to null.\r\n\nWhen using Bindings in XAML this can leads to bugs in the graphical interface where properties dissaperas after a submit.\r\n\nExample:\r\n\nclass A and B have a 1:1 relationship (or 1:n) relationship and they are both related and have id 0 on the clients.\r\nThey are inserted as part of the same SubmitChanges\r\nWhen processing the submit result property changes are raised for \"a.B\" and \"b.A\", under some coditions (determined if principal or dependent entity get processed first\"), a.B might be null during the last \"PropertyChange\" event for \"a.B\" (or reverse):\r\nCurrently the order in which the changes are processed determine if the bug appears or not.\r\n\n\nExample of the bug:\r\n\nStart: \n\na.B reference entity \"b\", a.Id = 0 (A's key)\n\nb.A reference entity \"a\", a.Id = 0 (B's key), b.AId = 0 (FK to A)\n\n\nPropertyChanges (only part of all changes):\n\na get updated   (a.Id = 1023 ..., b.A = \"a\") \nPropertyChange \"b.A\" + \"b.AId\"  (a.id = 1023, a.EntityState = Unchanged, b.Id = 0 , b.EntityState = New, b.AId = 1023, b.A = null so UI get updated with \"blank/null\")\r\n, \"a.BId\", \"b.A\"  => (a.Id = 0, a.bId = 1, a.B = null, b.Id = 0, b.A = null, b.AId = 0) \nPropertyChange \"b.Id\"\nPropertyChange \"b.EntityState\" => (It is first now \"b.A\" returns \"a\" but since no PropertyChange event is raised the UI never get updated) \n\r\n\r\n#### This work item was migrated from CodePlex\r\nCodePlex work item ID: '82'\r\nAssigned to: 'danneesset'\r\nVote count: '1'\r\n"},"comment":{"url":"https://api.github.com/repos/Daniel-Svensson/test/issues/comments/342942732","html_url":"https://github.com/Daniel-Svensson/test/issues/82#issuecomment-342942732","issue_url":"https://api.github.com/repos/Daniel-Svensson/test/issues/82","id":342942732,"user":{"login":"Daniel-Svensson","id":3167509,"avatar_url":"https://avatars1.githubusercontent.com/u/3167509?v=4","gravatar_id":"","url":"https://api.github.com/users/Daniel-Svensson","html_url":"https://github.com/Daniel-Svensson","followers_url":"https://api.github.com/users/Daniel-Svensson/followers","following_url":"https://api.github.com/users/Daniel-Svensson/following{/other_user}","gists_url":"https://api.github.com/users/Daniel-Svensson/gists{/gist_id}","starred_url":"https://api.github.com/users/Daniel-Svensson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Daniel-Svensson/subscriptions","organizations_url":"https://api.github.com/users/Daniel-Svensson/orgs","repos_url":"https://api.github.com/users/Daniel-Svensson/repos","events_url":"https://api.github.com/users/Daniel-Svensson/events{/privacy}","received_events_url":"https://api.github.com/users/Daniel-Svensson/received_events","type":"User","site_admin":false},"created_at":"2017-11-08T20:05:44Z","updated_at":"2017-11-08T20:05:44Z","author_association":"OWNER","body":"[danneesset@2015-10-06]\r\nFixed in changeset 4b0a6d23e54f38c058861d74220fafa786fbf76f\r\n\r\n"}}
{"actor":{"display_login":"Daniel-Svensson"}}