0
我有如下的類:LINQ到基於組總結兩列
Class Financial
{
string Debit;
string Credit;
decimal Amount;
}
而且我有這個類的對象列表,多個記錄。所有我需要的是像SQL
Select debit, Credit, sum(amount) group by Debit, Credit
我有如下的聲明試圖進行細分電子郵件總和,東西:
from operation in m_listOperations
orderby operation.Debit, operation.Credit ascending
group operation by operation.Debit, operation.Credit into groupedOperation
select new Financial(Debit, Credit,
groupedOperation.Sum(operation => operation.Amount))
但是,這並不工作,因爲我不能在兩列組。
有什麼建議嗎?