1
我真的以爲我是越來越與LINQ到現在爲止,我已經有了一個一對多的關係,我需要返回SUM爲Jobitems(jobitems.Cost)的LINQ集團及SUM
List<Models.Inventory.JobItem> jobItems = BLL.Inventory.JobItem.GetAllActive(forceReload);
List<.Models.Inventory.Job> jobs = BLL.Inventory.Job.GetAllActive(forceReload);
var getInvoicedItems2 = from j in jobs
join ji in jobItems on j.JobId equals ji.JobId
select new { JobCost = ji.Cost, JobId = ji.JobId};
Ive得到這很遠,但我不知道如何按ji組合所有.JobId
感謝傑夫,我這樣做,它似乎工作 – David 2011-02-16 09:09:51