{"action":"created","issue":{"url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/40","repository_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator","labels_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/40/comments","events_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/40/events","html_url":"https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/40","id":153785269,"number":40,"title":"Many-to-many does not use proper naming","user":{"login":"revbones","id":723257,"avatar_url":"https://avatars.githubusercontent.com/u/723257?v=3","gravatar_id":"","url":"https://api.github.com/users/revbones","html_url":"https://github.com/revbones","followers_url":"https://api.github.com/users/revbones/followers","following_url":"https://api.github.com/users/revbones/following{/other_user}","gists_url":"https://api.github.com/users/revbones/gists{/gist_id}","starred_url":"https://api.github.com/users/revbones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revbones/subscriptions","organizations_url":"https://api.github.com/users/revbones/orgs","repos_url":"https://api.github.com/users/revbones/repos","events_url":"https://api.github.com/users/revbones/events{/privacy}","received_events_url":"https://api.github.com/users/revbones/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-09T14:10:26Z","updated_at":"2016-05-11T16:04:11Z","closed_at":null,"body":"It appears that in a many to many relationship, the first navigational property should be the plural without the foreign key and without \"1\" appended but in version 2.19 this does not happen. \r\n\r\nFor instance, we have the following tables:\r\nRoles (RoleId)\r\nPermission (PermissionId)\r\nRolePermission (RoleId, PermissionId)\r\n\r\nIn the generated Role class, instead of a \"Permissions\" property in the reverse navigation , we get a property for \"Permissions_PermissionId\" and another for \"Permissions1\".\r\n\r\nSimilarly, in the generated Permission class we get properties \"Roles_RoleId\" and \"Roles1\". \r\n\r\nIt seems like the intention was to have a result where the Role class would have a property named \"Permissions\" and a second one named either \"Permissions1\" or \"Permissions_PermissionId\" - which would be fine if that was the result.\r\n\r\nIt appears that the error is in the POCO.Core.ttinclude with the conditional:\r\n\r\n```c#\r\nif (!ReverseNavigationUniquePropNameClashes.Contains(tableNameHumanCase) &&\r\n    !ReverseNavigationUniquePropName.Contains(tableNameHumanCase))\r\n{\r\n    ReverseNavigationUniquePropName.Add(tableNameHumanCase);\r\n    return tableNameHumanCase;\r\n}\r\n```\r\nWhich sees the name clash so the normal and probably intended naming doesn't happen on the first instance."},"comment":{"url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/comments/218506706","html_url":"https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/40#issuecomment-218506706","issue_url":"https://api.github.com/repos/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/issues/40","id":218506706,"user":{"login":"sjh37","id":4190514,"avatar_url":"https://avatars.githubusercontent.com/u/4190514?v=3","gravatar_id":"","url":"https://api.github.com/users/sjh37","html_url":"https://github.com/sjh37","followers_url":"https://api.github.com/users/sjh37/followers","following_url":"https://api.github.com/users/sjh37/following{/other_user}","gists_url":"https://api.github.com/users/sjh37/gists{/gist_id}","starred_url":"https://api.github.com/users/sjh37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjh37/subscriptions","organizations_url":"https://api.github.com/users/sjh37/orgs","repos_url":"https://api.github.com/users/sjh37/repos","events_url":"https://api.github.com/users/sjh37/events{/privacy}","received_events_url":"https://api.github.com/users/sjh37/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T16:04:11Z","updated_at":"2016-05-11T16:04:11Z","body":"Got it thanks :+1: "}}