我有以下串列(InputData),我想先按供應商分組, 然后按型別分組,按NumberInvoice匯總,按月份 連接,
uj5u.com熱心網友回復:
這將起作用
var result = InputData
.OrderBy(x => x.Month)
.GroupBy(x => x.Month)
.SelectMany(x => x.GroupBy(y => new {y.Vendor, y.Type, y.NumberInvoice})
.Select(y => new { Vendor = y.Key.Vendor, Type = y.Key.Type, month = x.Key, numberInvoices = y.Count()}).ToList()).ToList();
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/526955.html
標籤:C#林克
