Hi Frans
The logic for "HasValue" when using nullable types seems to be incorrect - item.HasValue should generate "IS NOT NULL" but generates "IS NULL" instead.
This query against northwind should produce 830 results, but instead produces 0:
var linq = new LinqMetaData(adapter);
var query = from o in linq.Order
where o.Freight.HasValue
select o;
Here's the SQL:
SELECT DISTINCT
[LPLA_1].[OrderID] AS [OrderId],
[LPLA_1].[CustomerID] AS [CustomerId],
[LPLA_1].[EmployeeID] AS [EmployeeId],
[LPLA_1].[OrderDate],
[LPLA_1].[RequiredDate],
[LPLA_1].[ShippedDate],
[LPLA_1].[ShipVia],
[LPLA_1].[Freight],
[LPLA_1].[ShipName],
[LPLA_1].[ShipAddress],
[LPLA_1].[ShipCity],
[LPLA_1].[ShipRegion],
[LPLA_1].[ShipPostalCode],
[LPLA_1].[ShipCountry]
FROM
[Northwind].[dbo].[Orders] [LPLA_1]
WHERE ( ( ( ( [LPLA_1].[Freight] IS NULL))))