{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/682","repository_url":"https://api.github.com/repos/aspnet/EntityFramework6","labels_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/682/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/682/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/682/events","html_url":"https://github.com/aspnet/EntityFramework6/issues/682","id":394445222,"node_id":"MDU6SXNzdWUzOTQ0NDUyMjI=","number":682,"title":"EF6 UseDatabaseNullSemantics = true has no effect on LINQ JOIN","user":{"login":"bfmone","id":46198628,"node_id":"MDQ6VXNlcjQ2MTk4NjI4","avatar_url":"https://avatars0.githubusercontent.com/u/46198628?v=4","gravatar_id":"","url":"https://api.github.com/users/bfmone","html_url":"https://github.com/bfmone","followers_url":"https://api.github.com/users/bfmone/followers","following_url":"https://api.github.com/users/bfmone/following{/other_user}","gists_url":"https://api.github.com/users/bfmone/gists{/gist_id}","starred_url":"https://api.github.com/users/bfmone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfmone/subscriptions","organizations_url":"https://api.github.com/users/bfmone/orgs","repos_url":"https://api.github.com/users/bfmone/repos","events_url":"https://api.github.com/users/bfmone/events{/privacy}","received_events_url":"https://api.github.com/users/bfmone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-27T17:06:26Z","updated_at":"2019-01-02T09:30:31Z","closed_at":null,"author_association":"NONE","body":"Hi, \r\n\r\nI am using EF 6.2.0 and setting dbContext.Configuration.UseDatabaseNullSemantics = true; \r\nthis does not affect the SQL produced by the JOIN operator :\r\n\r\nSQL Output:\r\nFROM      [dbo].[F_DETALHES] AS [Extent1]\r\n    INNER JOIN [dbo].[FATURA] AS [Extent2] ON [Extent1].[Pk_factura] = [Extent2].[Pk]\r\n    LEFT OUTER JOIN [dbo].[LINHAS_PARA_FATURAR] AS [Extent3] ON ([Extent3].[pk_cliente] IS NOT NULL) AND ([Extent1].[Pk] = [Extent3].[Pk_detalhe_factura_cliente]) AND (([Extent1].[pk_cliente] = [Extent3].[pk_cliente]) **OR (([Extent1].[pk_cliente] IS NULL) AND ([Extent3].[pk_cliente] IS NULL)**))\r\n\r\n\r\nQuery:\r\nvar query = (from detail in dbContext.F_DETALHES.AsNoTracking()\r\njoin invoice in dbContext.FATURA on detail.Pk_factura equals invoice.Pk\r\njoin cp in dbContext.LINHAS_PARA_FATURAR on new { pk = detail.Pk, cliente = detail.pk_cliente} equals new { pk = (Guid)cp.Pk_detalhe_factura_cliente, cliente = cp.pk_cliente} into cpAux\r\nfrom cpLeftJoin in cpAux.DefaultIfEmpty()\r\n...\r\n\r\npk_cliente is nullable<Guid> in each table\r\n\r\n\r\nFound a similar bug in archive.codeplex.com but it still is not fixed.\r\nthe solution given in the codeplex bug was to move the join to the were clause, but I cant do that in case of left joins.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/comments/450818309","html_url":"https://github.com/aspnet/EntityFramework6/issues/682#issuecomment-450818309","issue_url":"https://api.github.com/repos/aspnet/EntityFramework6/issues/682","id":450818309,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDgxODMwOQ==","user":{"login":"bfmone","id":46198628,"node_id":"MDQ6VXNlcjQ2MTk4NjI4","avatar_url":"https://avatars0.githubusercontent.com/u/46198628?v=4","gravatar_id":"","url":"https://api.github.com/users/bfmone","html_url":"https://github.com/bfmone","followers_url":"https://api.github.com/users/bfmone/followers","following_url":"https://api.github.com/users/bfmone/following{/other_user}","gists_url":"https://api.github.com/users/bfmone/gists{/gist_id}","starred_url":"https://api.github.com/users/bfmone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfmone/subscriptions","organizations_url":"https://api.github.com/users/bfmone/orgs","repos_url":"https://api.github.com/users/bfmone/repos","events_url":"https://api.github.com/users/bfmone/events{/privacy}","received_events_url":"https://api.github.com/users/bfmone/received_events","type":"User","site_admin":false},"created_at":"2019-01-02T09:30:31Z","updated_at":"2019-01-02T09:30:31Z","author_association":"NONE","body":"Hi there\r\nMy context simplified:\r\n```\r\n public partial class MyContext : DbContext\r\n    {\r\n        public MyContext(string connectionString)\r\n            : base(connectionString) {\r\n            ConfigureContext();\r\n        }\r\n     \r\n        private void ConfigureContext()\r\n        {\r\n            Database.SetInitializer<MyContext>(null);\r\n\r\n            this.Configuration.ProxyCreationEnabled = false;\r\n            this.Configuration.LazyLoadingEnabled = false;\r\n            this.Configuration.UseDatabaseNullSemantics = true;\r\n        }\r\n   // ...\r\n    }\r\n```\r\n\r\nAnd creation\r\n```\r\nusing (MyContext dbContext = new MyContext(myConnectionString))\r\n{\r\n      //query\r\n}\r\n```\r\n\r\nActually the EF version I am using is 6.1.3 but I tried to update to 6.2.0 and tested but with the same results.\r\n"}}
{"actor":{"display_login":"bfmone"}}