我正在嘗試執行查詢以生成裝箱單,並且需要一般訂單信息以及訂單包含的項目數。LINQ查詢以選擇對象並計數
這裏是我的基本查詢:
var orders = (from cert in _orderRepository.GetAll()
where !cert.PrintedPackSlip
orderby cert.CardNumber
//group cert by cert.CardNumber
//into certGrp
select cert);
我需要做的是通過CardNumber組和做多少訂單有卡號的計數。
我會理想它出來像字典,如果在所有可能的
我們是在談論L2EF還是L2SQL?如果是EF,請參閱我有關類似問題的問題:http://stackoverflow.com/questions/10723439/linq-to-entities-get-results-row-count-in-one-query – walther 2012-07-05 19:06:49
我的ORM非常流暢,非常友好。這仍然適用? – 2012-07-05 19:10:05