{"action":"created","issue":{"url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/551","repository_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql","labels_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/551/labels{/name}","comments_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/551/comments","events_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/551/events","html_url":"https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/551","id":326588559,"number":551,"title":"Conflict sql alias name.","user":{"login":"powerumc","id":1943755,"avatar_url":"https://avatars3.githubusercontent.com/u/1943755?v=4","gravatar_id":"","url":"https://api.github.com/users/powerumc","html_url":"https://github.com/powerumc","followers_url":"https://api.github.com/users/powerumc/followers","following_url":"https://api.github.com/users/powerumc/following{/other_user}","gists_url":"https://api.github.com/users/powerumc/gists{/gist_id}","starred_url":"https://api.github.com/users/powerumc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/powerumc/subscriptions","organizations_url":"https://api.github.com/users/powerumc/orgs","repos_url":"https://api.github.com/users/powerumc/repos","events_url":"https://api.github.com/users/powerumc/events{/privacy}","received_events_url":"https://api.github.com/users/powerumc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-25T16:25:23Z","updated_at":"2018-05-28T07:11:05Z","closed_at":null,"author_association":"NONE","body":"### Steps to reproduce\r\n```\r\n        public class Project\r\n\t{\r\n\t\tpublic Project() { }\r\n\r\n\t\tpublic Project(long id)\r\n\t\t{\r\n\t\t\tthis.Id = id;\r\n\t\t}\r\n\t\t\r\n\t\t/// <summary>\r\n\t\t/// Project Id\r\n\t\t/// </summary>\r\n\t\t[Key]\r\n\t\tpublic long Id { get; set; }\r\n\r\n\t\t[ForeignKey(\"CreateUserId\")]\r\n\t\tpublic User CreateUser { get; set; }\r\n\t\t\r\n\t\t[ForeignKey(\"ModifyUserId\")]\r\n\t\tpublic User ModifyUser { get; set; }\t\r\n\t}\r\n\r\n    public class User\r\n    {\r\n        public User() { }\r\n\r\n        public User(long id)\r\n        {\r\n            this.Id = id;\r\n        }\r\n        \r\n        [Key]\r\n        public long Id { get; set; }\r\n        \r\n        [Required]\r\n        [MaxLength(100)]\r\n        public string Name { get; set; }\r\n        \r\n        [Required]\r\n        [MaxLength(255)]\r\n        public string Email { get; set; }\r\n    }\r\n```\r\n\r\n### The issue\r\nGenerated sql is conflict alias name 'Email', 'Name'\r\n\r\n```\r\nSELECT `o`.`Id`, `o`.`CreateDate`, `o`.`CreateUserId`, `o`.`EndDate`, `o`.`HasProjectPeriod`, `o`.`IsActivated`, `o`.`IsDeleted`, `o`.`ModifyDate`, `o`.`ModifyUserId`, `o`.`Name`, `o`.`OrganizationId`, `o`.`StartDate`, `o.ModifyUser`.`Id`, `o.ModifyUser`.`CreateDate`, `o.ModifyUser`.`Email`, `o.ModifyUser`.`IsDeleted`, `o.ModifyUser`.`ModifyDate`, `o.ModifyUser`.`Name`, `o.ModifyUser`.`OrganizationOwnerUserId`, `o.CreateUser`.`Id`, `o.CreateUser`.`CreateDate`, `o.CreateUser`.`Email`, `o.CreateUser`.`IsDeleted`, `o.CreateUser`.`ModifyDate`, `o.CreateUser`.`Name`, `o.CreateUser`.`OrganizationOwnerUserId`\r\nFROM `Projects` AS `o`\r\nLEFT JOIN `Users` AS `o.ModifyUser` ON `o`.`ModifyUserId` = `o.ModifyUser`.`Id`\r\nLEFT JOIN `Users` AS `o.CreateUser` ON `o`.`CreateUserId` = `o.CreateUser`.`Id`\r\nWHERE (`o`.`Id` = @__id_0) AND (`o`.`IsDeleted` = FALSE)\r\nLIMIT 1\r\n```\r\n\r\nSo always same CreateUser, ModifyUser.\r\n\r\nHow to fix it?\r\n\r\n### Further technical details\r\n\r\nMySQL version: Amazon AuroraDb\r\nOperating system: MacOs\r\nPomelo.EntityFrameworkCore.MySql version: 2.0.1\r\n\r\nOther details about my project setup:\r\n"},"comment":{"url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/comments/392439750","html_url":"https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/551#issuecomment-392439750","issue_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/551","id":392439750,"user":{"login":"powerumc","id":1943755,"avatar_url":"https://avatars3.githubusercontent.com/u/1943755?v=4","gravatar_id":"","url":"https://api.github.com/users/powerumc","html_url":"https://github.com/powerumc","followers_url":"https://api.github.com/users/powerumc/followers","following_url":"https://api.github.com/users/powerumc/following{/other_user}","gists_url":"https://api.github.com/users/powerumc/gists{/gist_id}","starred_url":"https://api.github.com/users/powerumc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/powerumc/subscriptions","organizations_url":"https://api.github.com/users/powerumc/orgs","repos_url":"https://api.github.com/users/powerumc/repos","events_url":"https://api.github.com/users/powerumc/events{/privacy}","received_events_url":"https://api.github.com/users/powerumc/received_events","type":"User","site_admin":false},"created_at":"2018-05-28T07:11:05Z","updated_at":"2018-05-28T07:11:05Z","author_association":"NONE","body":"The query is generated by entity framework."}}
{"actor":{"display_login":"powerumc"}}