名前付きタイプが定義されています-いくつかのプロパティを持つ合計。
現在、匿名型に戻ってくる合計がいくつかあります。
Dim filteredList = Aggregate ts As Totals In empTot
Where ts.Status = "Active" Into
Tot1= Sum(ts.Tot1), Tot2= Sum(ts.Tot2)
選択でできるのと同じ方法で名前付きタイプを使用したい:
Dim londonCusts5 = From cust In customers
Where cust.City = "London"
Order By cust.Name Ascending
Select New NamePhone With
{
.Name = cust.Name,
.Phone = cust.Phone
}
MSDN Linq Docsから抜粋した例を選択- データ セクションの選択
Aggregateステートメントでこれは可能ですか?