{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3361","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3361/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3361/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3361/events","html_url":"https://github.com/aspnet/EntityFramework/issues/3361","id":110196583,"number":3361,"title":"Type conversion error with a DateTime constant in a dynamic Where expression (rc1)","user":{"login":"AlekseyMartynov","id":4426185,"avatar_url":"https://avatars.githubusercontent.com/u/4426185?v=3","gravatar_id":"","url":"https://api.github.com/users/AlekseyMartynov","html_url":"https://github.com/AlekseyMartynov","followers_url":"https://api.github.com/users/AlekseyMartynov/followers","following_url":"https://api.github.com/users/AlekseyMartynov/following{/other_user}","gists_url":"https://api.github.com/users/AlekseyMartynov/gists{/gist_id}","starred_url":"https://api.github.com/users/AlekseyMartynov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlekseyMartynov/subscriptions","organizations_url":"https://api.github.com/users/AlekseyMartynov/orgs","repos_url":"https://api.github.com/users/AlekseyMartynov/repos","events_url":"https://api.github.com/users/AlekseyMartynov/events{/privacy}","received_events_url":"https://api.github.com/users/AlekseyMartynov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/aspnet/EntityFramework/labels/pri0","name":"pri0","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"maumar","id":1591930,"avatar_url":"https://avatars.githubusercontent.com/u/1591930?v=3","gravatar_id":"","url":"https://api.github.com/users/maumar","html_url":"https://github.com/maumar","followers_url":"https://api.github.com/users/maumar/followers","following_url":"https://api.github.com/users/maumar/following{/other_user}","gists_url":"https://api.github.com/users/maumar/gists{/gist_id}","starred_url":"https://api.github.com/users/maumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maumar/subscriptions","organizations_url":"https://api.github.com/users/maumar/orgs","repos_url":"https://api.github.com/users/maumar/repos","events_url":"https://api.github.com/users/maumar/events{/privacy}","received_events_url":"https://api.github.com/users/maumar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/7","html_url":"https://github.com/aspnet/EntityFramework/milestones/7.0.0","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/milestones/7/labels","id":666128,"number":7,"title":"7.0.0","description":"","creator":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"open_issues":114,"closed_issues":45,"state":"open","created_at":"2014-05-21T19:25:32Z","updated_at":"2015-10-09T19:02:23Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-10-07T10:34:57Z","updated_at":"2015-10-09T19:03:16Z","closed_at":null,"body":"Sample project: https://github.com/AlekseyMartynov/ef7_const_bug\r\n\r\nI generate a dynamic Where condition with a `DateTime` constant ([code](https://github.com/AlekseyMartynov/ef7_const_bug/blob/master/Sample/Program.cs))\r\n\r\nAnd get a type conversion error (\"Conversion failed when converting date and/or time from character string.\") and the following generated SQL:\r\n\r\n    SELECT COUNT(*)\r\n    FROM [Orders] AS [i]\r\n    WHERE [i].[OrderDate] = '1998-05-06 00:00:00.0000000'"},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/comments/146962212","html_url":"https://github.com/aspnet/EntityFramework/issues/3361#issuecomment-146962212","issue_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/3361","id":146962212,"user":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T19:03:16Z","updated_at":"2015-10-09T19:03:16Z","body":"BTW if you split the date time value out into a variable rather than inline in the LINQ query it should work because it will get parameterized."}}