title: Getting list of values out of list of objects
body: <p>I have a simple class:  </p>
  
  <pre><code> private class Category
      {
          public int Id { get; set; }
          public string Value { get; set; }
      }  
  </code></pre>
  
  <p>an also a list of objects of this type:  </p>
  
  <pre><code> List&lt;Category&gt; Categories;
  </code></pre>
  
  <p>I need to get a list of Ids that are in Categories list. Is there a simpler way to do this than using for loop like this:  </p>
  
  <pre><code> List&lt;int&gt; list = new List&lt;int&gt;();
      for (int i = 0; i &lt; Categories.Count; i++)
      {
          list.Add(Categories[i].Id);
      }
  </code></pre>
  
  <p>Thanks in advance.</p>