是否可以使用LINQ来检索可能包含空值的列表。检索包含NULLS和Linq的列表
例如,如果我有一个左外连接,像这样:
var query= from c in db.Customers
join o in db.Orders
on c.CustomerID equals o.CustomerID into sr
from x in sr.DefaultIfEmpty()
select x.OrderId;
我如何得到一个列表可能看起来像{12,13的是,空,14,空,11,16,17 }?
这并没有为我工作:
query.ToList<decimal?>();
这可能吗?
你不解释你想要那些`null`对应的。没有订单的客户? – 2009-07-14 04:59:20