My problem is the (item1 < item2). What if these are objects that can't be compared?
var combinations = from item1 in list from item2 in list where item1 < item2 select Tuple.Create(item1, item2);
for (int I=0; I < list.Count; ++I) for (int j = I+1; j < list.Count; ++j) pairs.Add(new Pair(list[I], list[j]);
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.