私は以下のようなクラスを持っています:
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))
しかし、2つの列にグループ化できないため、これは機能しません。
助言がありますか?