{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/8763","repository_url":"https://api.github.com/repos/aspnet/EntityFramework","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/8763/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/8763/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/8763/events","html_url":"https://github.com/aspnet/EntityFramework/issues/8763","id":234130164,"number":8763,"title":"[Question] Separate or-statements when using left join","user":{"login":"joacar","id":439028,"avatar_url":"https://avatars2.githubusercontent.com/u/439028?v=3","gravatar_id":"","url":"https://api.github.com/users/joacar","html_url":"https://github.com/joacar","followers_url":"https://api.github.com/users/joacar/followers","following_url":"https://api.github.com/users/joacar/following{/other_user}","gists_url":"https://api.github.com/users/joacar/gists{/gist_id}","starred_url":"https://api.github.com/users/joacar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joacar/subscriptions","organizations_url":"https://api.github.com/users/joacar/orgs","repos_url":"https://api.github.com/users/joacar/repos","events_url":"https://api.github.com/users/joacar/events{/privacy}","received_events_url":"https://api.github.com/users/joacar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-07T08:26:01Z","updated_at":"2017-06-07T08:26:01Z","closed_at":null,"body":"### Further technical details\r\nEF Core version: 1.1.2\r\nDatabase Provider: Microsoft.EntityFrameworkCore.SqlServer\r\nOperating system: Windows 10\r\nIDE: Visual Studio 2017 Community\r\n\r\nI have posted a question to [Stackoverflow](https://stackoverflow.com/questions/44302390/ef-core-complex-query-left-join-with-and-condition) but the response is low so I take a shoot here to see if any one can point me in the right direction\r\n\r\nI'm looking to generate a query like below, where there will be more channels included later.\r\n\r\n```sql\r\nSELECT COUNT(*)\r\nFROM [Profiles] AS [p]\r\nLEFT JOIN [InstagramChannels] AS [c] ON [p].[Id] = [c].[ProfileId]\r\nLEFT JOIN [ProfileYoutube] AS [_] ON [p].[Id] = [_].[ProfileId]\r\nLEFT JOIN [YoutubeChannels] AS [c1] ON ([_].[YoutubeId] = [c1].[Id]) AND ([_].[IsPrimary] = 1)\r\nLEFT JOIN [BlogChannels] AS [c3] ON [p].[Id] = [c3].[ProfileId]\r\nWHERE [p].[IsCertified] = 1) AND ([c].[Id] IN (13584, 267, 279, 13771, 13626) OR [c1].[Id] IN (8025)) OR [c3].[Id] IN (5009, 3009))\r\n```\r\n\r\nThe algorithm works in several steps and each \"channel\" id is accumulated by multiple intersect statements. Is this possible to create using LINQ or should I resolve to using a stored procedure?\r\n"}}
{"actor":{"display_login":"joacar"}}