title: Optimal way to get Pairs of Objects from a List C#
body: <p>I have a List of objects named Team and I want the optimal way to get all the possible pairs of objects. I've written an example:</p>
  
  <pre><code>public void GenerateMatches(Team team)
      {
  
          for(int i = 0; i &lt; team.Count-1; i++)
          {
              for (int j = i + 1; j &lt; team.Count; j++)
              {
                  Console.WriteLine("Match:" + team[i].Name + " vs " + team[j].Name);
              }
          }
      }
  </code></pre>
  
  <p>This is far from optimal but it works. Any better ideas?</p>