title: How to convert from ICollection to IEnumerable?
body: <p>In the below code the return statement is throwing exception.</p>
  
  <pre><code>private IEnumerable&lt;DirectoryEntry&gt; GetDomains()
  {
      ICollection&lt;string&gt; domains = new List&lt;string&gt;();
  
      // Querying the current Forest for the domains within.
      foreach (Domain d in Forest.GetCurrentForest().Domains)
      {
          domains.Add(d.Name);
      }
  
      return domains;  //doesn't work
  }
  </code></pre>
  
  <p>What could be the possible resolution to this issue?</p>