{"action":"created","issue":{"url":"https://api.github.com/repos/kahanu/System.Linq.Dynamic/issues/53","repository_url":"https://api.github.com/repos/kahanu/System.Linq.Dynamic","labels_url":"https://api.github.com/repos/kahanu/System.Linq.Dynamic/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/kahanu/System.Linq.Dynamic/issues/53/comments","events_url":"https://api.github.com/repos/kahanu/System.Linq.Dynamic/issues/53/events","html_url":"https://github.com/kahanu/System.Linq.Dynamic/issues/53","id":154327015,"number":53,"title":"SqlFunctions in where clause","user":{"login":"ehsaanwelcome","id":2996859,"avatar_url":"https://avatars.githubusercontent.com/u/2996859?v=3","gravatar_id":"","url":"https://api.github.com/users/ehsaanwelcome","html_url":"https://github.com/ehsaanwelcome","followers_url":"https://api.github.com/users/ehsaanwelcome/followers","following_url":"https://api.github.com/users/ehsaanwelcome/following{/other_user}","gists_url":"https://api.github.com/users/ehsaanwelcome/gists{/gist_id}","starred_url":"https://api.github.com/users/ehsaanwelcome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehsaanwelcome/subscriptions","organizations_url":"https://api.github.com/users/ehsaanwelcome/orgs","repos_url":"https://api.github.com/users/ehsaanwelcome/repos","events_url":"https://api.github.com/users/ehsaanwelcome/events{/privacy}","received_events_url":"https://api.github.com/users/ehsaanwelcome/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-11T19:48:06Z","updated_at":"2016-05-24T19:52:40Z","closed_at":null,"body":"from\r\nquery.Where(o => SqlFunctions.StringConvert((double)product.Id).Contains(search))\r\nto\r\nquery.where(\"SqlFunctions.StringConvert((double)Id.Contains(@0), search)"},"comment":{"url":"https://api.github.com/repos/kahanu/System.Linq.Dynamic/issues/comments/221382860","html_url":"https://github.com/kahanu/System.Linq.Dynamic/issues/53#issuecomment-221382860","issue_url":"https://api.github.com/repos/kahanu/System.Linq.Dynamic/issues/53","id":221382860,"user":{"login":"StefH","id":249938,"avatar_url":"https://avatars.githubusercontent.com/u/249938?v=3","gravatar_id":"","url":"https://api.github.com/users/StefH","html_url":"https://github.com/StefH","followers_url":"https://api.github.com/users/StefH/followers","following_url":"https://api.github.com/users/StefH/following{/other_user}","gists_url":"https://api.github.com/users/StefH/gists{/gist_id}","starred_url":"https://api.github.com/users/StefH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefH/subscriptions","organizations_url":"https://api.github.com/users/StefH/orgs","repos_url":"https://api.github.com/users/StefH/repos","events_url":"https://api.github.com/users/StefH/events{/privacy}","received_events_url":"https://api.github.com/users/StefH/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T19:52:40Z","updated_at":"2016-05-24T19:52:40Z","body":"It should be like (for test see: https://github.com/StefH/System.Linq.Dynamic.Core/tree/master/src-console/System.Linq.Dynamic.Core.ConsoleTestApp.net452)\r\n\r\n``` c#\r\nclass Program\r\n{\r\n    static void Main(string[] args)\r\n    {\r\n        using (var context = new KendoGridDbContext())\r\n        {\r\n            string search = \"2\";\r\n            var expected = context.Employees.Where(e => System.Data.Entity.SqlServer.SqlFunctions.StringConvert((double) e.EmployeeNumber).Contains(search)).ToArray();\r\n            foreach (var emp in expected)\r\n            {\r\n                Console.WriteLine($\"System.Linq : {emp.Id} - {emp.EmployeeNumber}\");\r\n            }\r\n\r\n            var test = context.Employees.Where(\"SqlFunctions.StringConvert(double(it.EmployeeNumber)).Contains(@0)\", search).ToArray();\r\n            foreach (var emp in test)\r\n            {\r\n                Console.WriteLine($\"DynamicLinq : {emp.Id} - {emp.EmployeeNumber}\");\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nNote that a cast to **double** is required here because StringConvert has two options; with decimal and double."}}
{"actor":{"display_login":"StefH"}}