title: C# Lists, create list object from a list of objects
body: <p>I have a list object like this</p>
  
  <pre><code>List&lt;Site&gt; lsite = GetSitesById(Id);
  </code></pre>
  
  <p>and the Site object is </p>
  
  <pre><code>public Site(int nId, string name, int Count)
          {
              Id = nId;
              Name = name;
              SiteOverrideCount = Count;
          }
  </code></pre>
  
  <p>What I need is <code>List&lt;int&gt; OnlySites=</code> which will have a list of only Site Id's</p>
  
  <p>How can I get only id's from the lsite object, dump them in a list object and assign that to  List OnlySites</p>
  
  <p>I am new at this, hope my question made sense.</p>