{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/110","repository_url":"https://api.github.com/repos/aspnet/EntityFramework6","labels_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/110/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/110/events","html_url":"https://github.com/aspnet/EntityFramework6/issues/110","id":190393694,"number":110,"title":"Entity Properties with different column order as composite Key and ForeignKey ","user":{"login":"dlipkie","id":5233343,"avatar_url":"https://avatars.githubusercontent.com/u/5233343?v=3","gravatar_id":"","url":"https://api.github.com/users/dlipkie","html_url":"https://github.com/dlipkie","followers_url":"https://api.github.com/users/dlipkie/followers","following_url":"https://api.github.com/users/dlipkie/following{/other_user}","gists_url":"https://api.github.com/users/dlipkie/gists{/gist_id}","starred_url":"https://api.github.com/users/dlipkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlipkie/subscriptions","organizations_url":"https://api.github.com/users/dlipkie/orgs","repos_url":"https://api.github.com/users/dlipkie/repos","events_url":"https://api.github.com/users/dlipkie/events{/privacy}","received_events_url":"https://api.github.com/users/dlipkie/received_events","type":"User","site_admin":false},"labels":[{"id":418991742,"url":"https://api.github.com/repos/aspnet/EntityFramework6/labels/type-investigation","name":"type-investigation","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":{"login":"AndriySvyryd","id":6539701,"avatar_url":"https://avatars.githubusercontent.com/u/6539701?v=3","gravatar_id":"","url":"https://api.github.com/users/AndriySvyryd","html_url":"https://github.com/AndriySvyryd","followers_url":"https://api.github.com/users/AndriySvyryd/followers","following_url":"https://api.github.com/users/AndriySvyryd/following{/other_user}","gists_url":"https://api.github.com/users/AndriySvyryd/gists{/gist_id}","starred_url":"https://api.github.com/users/AndriySvyryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndriySvyryd/subscriptions","organizations_url":"https://api.github.com/users/AndriySvyryd/orgs","repos_url":"https://api.github.com/users/AndriySvyryd/repos","events_url":"https://api.github.com/users/AndriySvyryd/events{/privacy}","received_events_url":"https://api.github.com/users/AndriySvyryd/received_events","type":"User","site_admin":false},"assignees":[{"login":"AndriySvyryd","id":6539701,"avatar_url":"https://avatars.githubusercontent.com/u/6539701?v=3","gravatar_id":"","url":"https://api.github.com/users/AndriySvyryd","html_url":"https://github.com/AndriySvyryd","followers_url":"https://api.github.com/users/AndriySvyryd/followers","following_url":"https://api.github.com/users/AndriySvyryd/following{/other_user}","gists_url":"https://api.github.com/users/AndriySvyryd/gists{/gist_id}","starred_url":"https://api.github.com/users/AndriySvyryd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndriySvyryd/subscriptions","organizations_url":"https://api.github.com/users/AndriySvyryd/orgs","repos_url":"https://api.github.com/users/AndriySvyryd/repos","events_url":"https://api.github.com/users/AndriySvyryd/events{/privacy}","received_events_url":"https://api.github.com/users/AndriySvyryd/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/aspnet/EntityFramework6/milestones/1","html_url":"https://github.com/aspnet/EntityFramework6/milestones/6.2.0","labels_url":"https://api.github.com/repos/aspnet/EntityFramework6/milestones/1/labels","id":1905902,"number":1,"title":"6.2.0","description":"","creator":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":3,"state":"open","created_at":"2016-07-26T21:17:29Z","updated_at":"2016-11-22T20:01:31Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-11-18T18:50:52Z","updated_at":"2016-11-22T20:28:32Z","closed_at":null,"body":"I have two entities with properties, \"PropA\" and \"PropB\" that are used a parts of the entity composite primary key.\r\n\r\nEntity1 is associated with a database table that has a composite primary key [PropA, PropB].\r\n\r\nEntity2 is associated with a database table that has a composite primary key with the order reversed [PropB, PropA].\r\n\r\nAnd so the entity definitions associate Key and ColumnOrder values accordingly \r\n\r\nI am trying to define a 1-to-many relationship from Entity1 to Entity2 using Fluent API. \r\nI have tried using\r\n   .ForeignKey( x => new { x.PropA, x.PropB})\r\nand\r\n   .ForeignKey( x => new { x.PropB, x.PropA})\r\n\r\nOne fails to fill the virtual navigation properties because it is using the value of Entity2.PropA as when looking for Entity1.ProbB objects, e.g. SELECT ... WHERE (fieldPropB=\"valueOfEntity2PropA\", fieldPropA=\"valueOfEntity2PropB\"\r\n\r\nThe other throws a run time error\r\nERROR (3015): Problem in Mapping Fragments xxx Insufficient mapping: Foreign key must be mapped to some AssociationSet or ...\r\n\r\nThe only way I could get this work was to have the both entities agree on the ordering within the composite primary and then use that ordering in the ForeignKey.\r\n\r\nIs in possible for an entity property to have one order when used as a key and another when used as a foreignkey?\r\n\r\nThanks\r\nDaniel"},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/comments/262356366","html_url":"https://github.com/aspnet/EntityFramework6/issues/110#issuecomment-262356366","issue_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/110","id":262356366,"user":{"login":"dlipkie","id":5233343,"avatar_url":"https://avatars.githubusercontent.com/u/5233343?v=3","gravatar_id":"","url":"https://api.github.com/users/dlipkie","html_url":"https://github.com/dlipkie","followers_url":"https://api.github.com/users/dlipkie/followers","following_url":"https://api.github.com/users/dlipkie/following{/other_user}","gists_url":"https://api.github.com/users/dlipkie/gists{/gist_id}","starred_url":"https://api.github.com/users/dlipkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlipkie/subscriptions","organizations_url":"https://api.github.com/users/dlipkie/orgs","repos_url":"https://api.github.com/users/dlipkie/repos","events_url":"https://api.github.com/users/dlipkie/events{/privacy}","received_events_url":"https://api.github.com/users/dlipkie/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T20:28:32Z","updated_at":"2016-11-22T20:28:32Z","body":"Rowan, Thanks for clarification you added to #113 ... look forward to finding out where i missed the boat on understanding this topic."}}
{"actor":{"display_login":"dlipkie"}}