title: How can I use a LINQ projection with List<MyStructure> to get a NameValueCollection?
body: <p>I have a </p>
  
  <pre><code>var list = new List&lt;MyStructure&gt;();
  </code></pre>
  
  <p>I want to extract <code>MyStructure.Foo</code> and <code>MyStructure.Bar</code> and put these two in a <code>NameValueCollection</code>. I want <code>NameValueCollection</code> because I am using <code>WebClient.UploadValues()</code></p>
  
  <p>The following creates an <code>IEnumerable&lt;NamedValueCollection&gt;</code>. I need just a <code>NameValueCollection</code></p>
  
  <pre><code>var nameValueCollection = structure.Select(x =&gt; new NameValueCollection             
          { 
              { x.TypeId.ToString(), x.Value } 
          });
  </code></pre>
  
  <p>Thanks.</p>