LINQ to SQL - typy zerowe w klauzuli where
Mam tabelę z kolumną, która ma wartości puste ... gdy próbuję wyszukać rekordy, w których ta kolumna jest NULL:
TO DZIAŁA:
var list = from mt in db.MY_TABLE
where mt.PARENT_KEY == null
select new { mt.NAME };
TO NIE:
int? id = null;
var list = from mt in db.MY_TABLE
where mt.PARENT_KEY == id
select new { mt.NAME };
Czemu?