{"action":"created","issue":{"url":"https://api.github.com/repos/linq2db/linq2db/issues/973","repository_url":"https://api.github.com/repos/linq2db/linq2db","labels_url":"https://api.github.com/repos/linq2db/linq2db/issues/973/labels{/name}","comments_url":"https://api.github.com/repos/linq2db/linq2db/issues/973/comments","events_url":"https://api.github.com/repos/linq2db/linq2db/issues/973/events","html_url":"https://github.com/linq2db/linq2db/issues/973","id":288579661,"node_id":"MDU6SXNzdWUyODg1Nzk2NjE=","number":973,"title":"Is there a way to parameterize Contains query?","user":{"login":"arwyl","id":773764,"node_id":"MDQ6VXNlcjc3Mzc2NA==","avatar_url":"https://avatars3.githubusercontent.com/u/773764?v=4","gravatar_id":"","url":"https://api.github.com/users/arwyl","html_url":"https://github.com/arwyl","followers_url":"https://api.github.com/users/arwyl/followers","following_url":"https://api.github.com/users/arwyl/following{/other_user}","gists_url":"https://api.github.com/users/arwyl/gists{/gist_id}","starred_url":"https://api.github.com/users/arwyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arwyl/subscriptions","organizations_url":"https://api.github.com/users/arwyl/orgs","repos_url":"https://api.github.com/users/arwyl/repos","events_url":"https://api.github.com/users/arwyl/events{/privacy}","received_events_url":"https://api.github.com/users/arwyl/received_events","type":"User","site_admin":false},"labels":[{"id":533878923,"node_id":"MDU6TGFiZWw1MzM4Nzg5MjM=","url":"https://api.github.com/repos/linq2db/linq2db/labels/bug","name":"bug","color":"b60205","default":true},{"id":850191368,"node_id":"MDU6TGFiZWw4NTAxOTEzNjg=","url":"https://api.github.com/repos/linq2db/linq2db/labels/critical","name":"critical","color":"fbca04","default":false},{"id":509185598,"node_id":"MDU6TGFiZWw1MDkxODU1OTg=","url":"https://api.github.com/repos/linq2db/linq2db/labels/feature","name":"feature","color":"c2e0c6","default":false},{"id":872316954,"node_id":"MDU6TGFiZWw4NzIzMTY5NTQ=","url":"https://api.github.com/repos/linq2db/linq2db/labels/patch-proposed","name":"patch-proposed","color":"99ed84","default":false}],"state":"closed","locked":false,"assignee":{"login":"sdanyliv","id":783759,"node_id":"MDQ6VXNlcjc4Mzc1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/783759?v=4","gravatar_id":"","url":"https://api.github.com/users/sdanyliv","html_url":"https://github.com/sdanyliv","followers_url":"https://api.github.com/users/sdanyliv/followers","following_url":"https://api.github.com/users/sdanyliv/following{/other_user}","gists_url":"https://api.github.com/users/sdanyliv/gists{/gist_id}","starred_url":"https://api.github.com/users/sdanyliv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdanyliv/subscriptions","organizations_url":"https://api.github.com/users/sdanyliv/orgs","repos_url":"https://api.github.com/users/sdanyliv/repos","events_url":"https://api.github.com/users/sdanyliv/events{/privacy}","received_events_url":"https://api.github.com/users/sdanyliv/received_events","type":"User","site_admin":false},"assignees":[{"login":"sdanyliv","id":783759,"node_id":"MDQ6VXNlcjc4Mzc1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/783759?v=4","gravatar_id":"","url":"https://api.github.com/users/sdanyliv","html_url":"https://github.com/sdanyliv","followers_url":"https://api.github.com/users/sdanyliv/followers","following_url":"https://api.github.com/users/sdanyliv/following{/other_user}","gists_url":"https://api.github.com/users/sdanyliv/gists{/gist_id}","starred_url":"https://api.github.com/users/sdanyliv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdanyliv/subscriptions","organizations_url":"https://api.github.com/users/sdanyliv/orgs","repos_url":"https://api.github.com/users/sdanyliv/repos","events_url":"https://api.github.com/users/sdanyliv/events{/privacy}","received_events_url":"https://api.github.com/users/sdanyliv/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/linq2db/linq2db/milestones/8","html_url":"https://github.com/linq2db/linq2db/milestone/8","labels_url":"https://api.github.com/repos/linq2db/linq2db/milestones/8/labels","id":3314379,"node_id":"MDk6TWlsZXN0b25lMzMxNDM3OQ==","number":8,"title":"2.1.0","description":"","creator":{"login":"MaceWindu","id":1099238,"node_id":"MDQ6VXNlcjEwOTkyMzg=","avatar_url":"https://avatars1.githubusercontent.com/u/1099238?v=4","gravatar_id":"","url":"https://api.github.com/users/MaceWindu","html_url":"https://github.com/MaceWindu","followers_url":"https://api.github.com/users/MaceWindu/followers","following_url":"https://api.github.com/users/MaceWindu/following{/other_user}","gists_url":"https://api.github.com/users/MaceWindu/gists{/gist_id}","starred_url":"https://api.github.com/users/MaceWindu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaceWindu/subscriptions","organizations_url":"https://api.github.com/users/MaceWindu/orgs","repos_url":"https://api.github.com/users/MaceWindu/repos","events_url":"https://api.github.com/users/MaceWindu/events{/privacy}","received_events_url":"https://api.github.com/users/MaceWindu/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":22,"state":"open","created_at":"2018-05-02T12:14:56Z","updated_at":"2018-06-14T14:43:00Z","due_on":"2018-06-21T07:00:00Z","closed_at":null},"comments":37,"created_at":"2018-01-15T12:33:36Z","updated_at":"2018-06-18T16:01:14Z","closed_at":"2018-06-08T15:25:06Z","author_association":"NONE","body":"Currently linq query with Contains method generates sql operator \"in\" with inlined parameters.\r\n\r\nFor example:\r\n\r\n```\r\n[Test]\r\n\t\tpublic void __Linq2Db_InlineParameters_For_Contains()\r\n\t\t{\r\n\t\t\tvar ids = new int[] { 1, 2, 3 };\r\n\r\n\t\t\tusing (var db = GetConnection())\r\n\t\t\t{\r\n\t\t\t\tvar query = db.Users.Where(x => ids.Contains(x.Id));\r\n\r\n\t\t\t\tConsole.WriteLine(query);\r\n\t\t\t}\r\n\t\t}\r\n```\r\n\r\ngenerates:\r\n\r\n```\r\nSELECT\r\n\t[t1].[Id],\r\n\t[t1].[Name],\r\n\t[t1].[IsActive],\r\n\t[t1].[AppointmentId]\r\nFROM\r\n\t[Users] [t1]\r\nWHERE\r\n\t[t1].[Id] IN (1, 2, 3)\r\n```\r\n\r\nIs there a way to generate something like [t1].[Id] IN (@p0, @p1, @p2)?\r\n\r\n### Environment details\r\nlinq2db version: 1.10.1\r\nDatabase Server: SqlServer 2016 \r\nDatabase Provider: SqlServer.2012\r\nOperating system: Windows 10\r\nFramework version: .NET Framework 4.6.2\r\n"},"comment":{"url":"https://api.github.com/repos/linq2db/linq2db/issues/comments/398105669","html_url":"https://github.com/linq2db/linq2db/issues/973#issuecomment-398105669","issue_url":"https://api.github.com/repos/linq2db/linq2db/issues/973","id":398105669,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODEwNTY2OQ==","user":{"login":"sdanyliv","id":783759,"node_id":"MDQ6VXNlcjc4Mzc1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/783759?v=4","gravatar_id":"","url":"https://api.github.com/users/sdanyliv","html_url":"https://github.com/sdanyliv","followers_url":"https://api.github.com/users/sdanyliv/followers","following_url":"https://api.github.com/users/sdanyliv/following{/other_user}","gists_url":"https://api.github.com/users/sdanyliv/gists{/gist_id}","starred_url":"https://api.github.com/users/sdanyliv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdanyliv/subscriptions","organizations_url":"https://api.github.com/users/sdanyliv/orgs","repos_url":"https://api.github.com/users/sdanyliv/repos","events_url":"https://api.github.com/users/sdanyliv/events{/privacy}","received_events_url":"https://api.github.com/users/sdanyliv/received_events","type":"User","site_admin":false},"created_at":"2018-06-18T16:01:14Z","updated_at":"2018-06-18T16:01:14Z","author_association":"MEMBER","body":"@arwyl, yes, i have reproduced error.\r\nProblem is obvious but i don't not how to handle this correctly without loosing performance.\r\nIf you reuse variable `ids` we can not handle when this variable was changed and always compares data in cache with latest variable value.\r\nIOW, if you want this functionality to be working - do not reuse local variables. For each query set values from new variable.\r\n\r\n"}}
{"actor":{"display_login":"sdanyliv"}}