title: How to implement IEnumerable<T> with GetEnumerator()?
body: <p>I would like my type to implement <code>IEnumerable&lt;string&gt;</code> . I tried to follow C# in a Nutshell, but something went wrong:</p>
  
  <pre><code>public class Simulation : IEnumerable&lt;string&gt;
  {
      private IEnumerable&lt;string&gt; Events()
      {
          yield return "a";
          yield return "b";
      }
  
      public IEnumerator&lt;string&gt; GetEnumerator()
      {
          return Events().GetEnumerator();
      }
  }
  </code></pre>
  
  <p>But I get the build error</p>
  
  <blockquote>
    <p>Error 1   'EventSimulator.Simulation' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'EventSimulator.Simulation.GetEnumerator()' cannot implement 'System.Collections.IEnumerable.GetEnumerator()' because it does not have the matching return type of 'System.Collections.IEnumerator'.</p>
  </blockquote>