I have a very simple LINQ To Entities query as follows:
var orderID = 1;
var orders = (from o in db.Orders
where o.OrderID == orderID
select o).SingleOrDefault();
Can anyone tell me why this query wouldn't work? It doesn't even not throw an exception. I have also checked the SQL profiler and the above query does not even fire the corresponding SQL query. But when I directly plugin the value of the orderID into the query where o.OrderID == 1 then everything works fine.