【发布时间】:2011-12-20 22:43:06
【问题描述】:
John Skeets 回答了这个问题,Select all unique combinations of a single list, with no repeats, using LINQ,效果很好。
但是,有人可以按组件分解第一个答案的内部工作原理吗:
List<int> slotIds = new List<int> {1, 2, 3};
var query = slotIds.SelectMany((value, index) => slotIds.Skip(index + 1),
(first, second) => new { first, second });
【问题讨论】:
-
你为什么不在那个答案下的评论中问这个?