title: C# extracting ID from list of structures using LINQ
body: <p>I have a list of structures:</p>
  
  <pre><code>struct MyStruct{
      int ID;
      string name;
      string surname;
  }
  List&lt;MyStruct&gt; list1 = new List&lt;MyStruct&gt;();
  ///here the list is being updated so that it has some elements
  </code></pre>
  
  <p>Now I want to extract from <strong>list1</strong> all <strong>ID</strong>'s and put into another list:</p>
  
  <pre><code>List&lt;int&gt; list2 = new List&lt;int&gt;();
  list2.AddRange(list1.GetIds() /*LINQ HERE*/);
  </code></pre>
  
  <p>The trick is I would like to use LINQ to do it but I still don't understand it quite well. I know it can be done with ordinary <em>for loop</em> but <strong>I want to use AddRange and LINQ</strong>.</p>