title: When should you use IEnumerable and GetEnumerator?
body: <p>In many of our projects I have seen a few custom collection / or container classes that hold a some sort of generic collection, e.g. a <code>List(of T)</code> class.</p>
  
  <p>They usually have a GetXXX method that returns a IEnumerable of whatever type the custom collection class uses so the internal collection can be iterated around using a foreach loop.</p>
  
  <p>e.g. </p>
  
  <pre><code>public IEnumerable&lt;UploadState&gt; GetStates
  {
      get
      {
          return new List&lt;UploadState&gt;(m_states);
      }
  }
  </code></pre>
  
  <p>My question is that should these classes instead implement the <code>IEnumerable</code> interface, and call <code>GetEnumerator</code> on the List itself.</p>
  
  <p>Is there a preferred way, or is it up to the developer?</p>