0
我有以下查詢:LINQ到實體總金額
var query = (from o in orders
group new
{
o.OrderDate,
o.paymenttotal
}
by new
{
o.OrderDate.Value.Month,
o.OrderDate.Value.Year
} into grouping
orderby grouping.Key.Month
select new
{
grouping,
totalPayment = grouping.Sum (g => g.paymenttotal)
});
query.Dump();
查詢工作得很好,它給打破總每個月下來,我想擴展查詢還加總和所有總計,所以我可以有一個「Footer Total」。
希望是有道理的。