var nums = new[]{ 1, 2, 3, 4, 5, 6, 7}; var pairs = /* some linq magic here*/ ;
=> pairs = {{1,2},{3,4},{5,6},{7,0}}
元素pairs应该是两元素列表,或者是一些具有两个字段的匿名类的实例,例如new {First = 1, Second = 2}.
pairs
new {First = 1, Second = 2}
c# linq linq-to-objects aggregate slice
aggregate ×1
c# ×1
linq ×1
linq-to-objects ×1
slice ×1