title: Process every pair in a sequence
body: <p>I'm looking for a concise way to process every (unordered) pair of elements in a sequence in .NET.
  I know I can do it with nested <code>for</code> loops, but I was looking for something a little more readable.</p>
  
  <p>I was imagining something like a modified <code>Any()</code> extension method:</p>
  
  <pre><code>IEnumerable&lt;Transaction&gt; transactions = ...
  if (transactions.AnyPair( (first, second) =&gt; first.UniqueID == second.UniqueID))
      throw ...
  </code></pre>
  
  <p>Or maybe a <code>foreach</code>-style one:</p>
  
  <pre><code>IEnumerable&lt;JigsawPiece&gt; pieces = ...
  pieces.ForEachPair( (first, second) =&gt; {
      TryFit(first, second);
  });
  </code></pre>
  
  <p>This question has been asked for other languages (e.g. see <a href="https://stackoverflow.com/questions/942543/operation-on-every-pair-of-element-in-a-list">Operation on every pair of element in a list</a>), but I'm looking for a .NET solution.</p>