title: How to use LINQ to take x rows from a multi column list
body: <p>I have a list that looks something like this:</p>
  
  <pre><code>catId    itemId    value
    1        5         "some text"
    1        19        "some text"
    1        21        "some text"
    2        6         "some text"
    2        8         "some text"
    3        9         "some text"
    3        82        "some text"
  </code></pre>
  
  <p>Notice the <code>catId</code> column. How would I take 2 rows(or remove extra rows) for each unique value in the first colum. Only 2 rows for <code>catId=1</code> 2 rows for <code>catId=2</code> and so on?</p>
  
  <p>My list is called <code>distinctXSelling</code> and I'm using it like this currently:</p>
  
  <pre><code>            foreach (var item in distinctXSelling)
              {
                  xSelling.InnerHtml += item.value;
              }
  </code></pre>