John Skeets對此問題的回答爲Select all unique combinations of a single list, with no repeats, using LINQ,工作非常棒。使用LINQ(第2部分)選擇單個列表的所有唯一組合,但不重複使用LINQ(第2部分)
然而,有人可以通過組件分解成分的第一個答案是如何工作的內部運作:
List<int> slotIds = new List<int> {1, 2, 3};
var query = slotIds.SelectMany((value, index) => slotIds.Skip(index + 1),
(first, second) => new { first, second });
你爲什麼不在這個答案的評論中提問? –