{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/5235","repository_url":"https://api.github.com/repos/aspnet/EntityFramework","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/5235/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/5235/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/5235/events","html_url":"https://github.com/aspnet/EntityFramework/issues/5235","id":152059573,"number":5235,"title":"Problem EF Core 1(RC2) - Command Where()","user":{"login":"ralmsdeveloper","id":16335882,"avatar_url":"https://avatars.githubusercontent.com/u/16335882?v=3","gravatar_id":"","url":"https://api.github.com/users/ralmsdeveloper","html_url":"https://github.com/ralmsdeveloper","followers_url":"https://api.github.com/users/ralmsdeveloper/followers","following_url":"https://api.github.com/users/ralmsdeveloper/following{/other_user}","gists_url":"https://api.github.com/users/ralmsdeveloper/gists{/gist_id}","starred_url":"https://api.github.com/users/ralmsdeveloper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralmsdeveloper/subscriptions","organizations_url":"https://api.github.com/users/ralmsdeveloper/orgs","repos_url":"https://api.github.com/users/ralmsdeveloper/repos","events_url":"https://api.github.com/users/ralmsdeveloper/events{/privacy}","received_events_url":"https://api.github.com/users/ralmsdeveloper/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-30T23:47:48Z","updated_at":"2016-04-30T23:47:48Z","closed_at":null,"body":"## Hello friends,\r\nI have a very strange case, if I make an appointment without declaring a variable EF Core 1 RC2, returns me all record of my table, but when I declare the variable he obeys the command!\r\n\r\nExample\r\n\r\n var Database = new JamsoftBanco.JamsoftBancoContext(); \r\n  var c01 = Database.Cargos.Where(p=>p.codcargo<int.Parse(id)).Take(1).OrderByDescending(r=>r.codcargo).ToListAsync();\r\n\r\n## Produces the following command\r\n**SELECT [p].[codcargo], [p].[nomecargo]\r\nFROM [Cargos] AS [p]**\r\n                   \r\n var _Codigo = int.Parse(id);\r\n var c02 = Database.Cargos.Where(p=>p.codcargo<_Codigo).Take(1).OrderByDescending(r=>r.codcargo).ToListAsync();\r\n\r\n\r\n## Produces the following command\r\n\r\n**exec sp_executesql N'SELECT [t].[codcargo], [t].[nomecargo]\r\nFROM (\r\n    SELECT TOP(@__p_1) [p0].[codcargo], [p0].[nomecargo]\r\n    FROM [Cargos] AS [p0]\r\n    WHERE [p0].[codcargo] < @___Codigo_0\r\n) AS [t]\r\nORDER BY [t].[codcargo] DESC',N'@__p_1 int,@___Codigo_0 int',@__p_1=1,@___Codigo_0=2008**\r\n\r\n\r\nNote that the only difference is the variable** \"_Codigo \"** that is recendo value without this within the lambda expression Where () command\r\n\r\nKind of weird not ?!\r\n"}}