title: Convert List<Cookie> to CookieCollection in C#
body: <p>Let's say I have <code>List&lt;Cookie&gt;</code> and I want to convert it to a <code>CookieCollection</code>. What's the easiest way to do this?</p>
  
  <p>I know I can use a foreach loop, but isn't there a way to instantiate it with code similar to this?</p>
  
  <pre><code>List&lt;Cookie&gt; l = ...;
  var c = new CookieCollection() { l };
  </code></pre>
  
  <p>When I try to compile that though, I get the error:</p>
  
  <blockquote>
    <p>The best overloaded Add method
    'System.Net.CookieCollection.Add(System.Net.CookieCollection)'
    for the collection initializer has
    some invalid arguments</p>
  </blockquote>
  
  <p>btw, there are two <code>Add</code> methods that <code>CookieCollection</code> supports:</p>
  
  <pre><code>public void Add(Cookie cookie);
  public void Add(CookieCollection cookies);
  </code></pre>