我試圖讓只有在使用本LAMBDA聲明LINQ查詢只有那些細節
list = list.Where(c=> c.CustomerSalesPeople.Count>0);
一個細節的信息,但是我得到空例外,當我嘗試返回結果頭
return list.OrderBy(c => c.CustomerName).ToList();
我已經遍歷代碼,看到在我執行第一條語句後立即生成了空異常。有沒有更好的方法來實現這一點。
編輯
我試過的建議,我仍然得到一個空值。我想我會盡力解釋更好。我需要匹配該查詢
SELECT *
FROM [customer]
where customer_record_id in (select distinct(customer_id)from customer_sales_person)
是它的LINQ to對象/ SQL /實體空? – MarcinJuraszek 2013-02-25 07:34:57
其linq對象。他們是llblgen實體。 LLBLGen是ORM – ChampChris 2013-02-25 07:36:52
現在檢查我的答案 – 2013-02-25 07:55:26