{"action":"created","issue":{"url":"https://api.github.com/repos/martinjw/dbschemareader/issues/21","repository_url":"https://api.github.com/repos/martinjw/dbschemareader","labels_url":"https://api.github.com/repos/martinjw/dbschemareader/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/martinjw/dbschemareader/issues/21/comments","events_url":"https://api.github.com/repos/martinjw/dbschemareader/issues/21/events","html_url":"https://github.com/martinjw/dbschemareader/issues/21","id":192084552,"number":21,"title":"POCO column name error when column is both primary and foreign key","user":{"login":"MachineCognitis","id":22506293,"avatar_url":"https://avatars.githubusercontent.com/u/22506293?v=3","gravatar_id":"","url":"https://api.github.com/users/MachineCognitis","html_url":"https://github.com/MachineCognitis","followers_url":"https://api.github.com/users/MachineCognitis/followers","following_url":"https://api.github.com/users/MachineCognitis/following{/other_user}","gists_url":"https://api.github.com/users/MachineCognitis/gists{/gist_id}","starred_url":"https://api.github.com/users/MachineCognitis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MachineCognitis/subscriptions","organizations_url":"https://api.github.com/users/MachineCognitis/orgs","repos_url":"https://api.github.com/users/MachineCognitis/repos","events_url":"https://api.github.com/users/MachineCognitis/events{/privacy}","received_events_url":"https://api.github.com/users/MachineCognitis/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-28T18:41:37Z","updated_at":"2016-12-14T09:48:07Z","closed_at":"2016-12-01T18:54:38Z","body":"I am using the code generator to create POCO classes for my database schema. I have a Department table with a composite primary key BusinessUnitId + DepartmentId, The BusinessUnitId is also a foreign key to the BusinessUnit table. When the POCO class for Department is created, the Id suffix is stripped from BusinessUnitId (by the Namer.Name() function) and this creates two members with the same name (BusinessUnit) in the Department class. I guess the Id should not be removed when a column is also a primary key. What do you think?"},"comment":{"url":"https://api.github.com/repos/martinjw/dbschemareader/issues/comments/266990131","html_url":"https://github.com/martinjw/dbschemareader/issues/21#issuecomment-266990131","issue_url":"https://api.github.com/repos/martinjw/dbschemareader/issues/21","id":266990131,"user":{"login":"martinjw","id":2040281,"avatar_url":"https://avatars.githubusercontent.com/u/2040281?v=3","gravatar_id":"","url":"https://api.github.com/users/martinjw","html_url":"https://github.com/martinjw","followers_url":"https://api.github.com/users/martinjw/followers","following_url":"https://api.github.com/users/martinjw/following{/other_user}","gists_url":"https://api.github.com/users/martinjw/gists{/gist_id}","starred_url":"https://api.github.com/users/martinjw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinjw/subscriptions","organizations_url":"https://api.github.com/users/martinjw/orgs","repos_url":"https://api.github.com/users/martinjw/repos","events_url":"https://api.github.com/users/martinjw/events{/privacy}","received_events_url":"https://api.github.com/users/martinjw/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T09:48:07Z","updated_at":"2016-12-14T09:48:07Z","body":"More issues around naming composite primary keys which are also foreign keys. \r\n\r\nThere's a pre-release at https://github.com/martinjw/dbschemareader/releases/tag/2.2.0.9\r\n\r\nIt's possible there are other naming collisions, but this fixes the issues for the tables you supplied."}}
{"actor":{"display_login":"martinjw"}}