title: How to implement Iterator pattern (IEnumerator<T>) without the yield statement
body: <p>How could I rewrite <code>GetEnumerator</code> method without using <code>yield</code> keyword?
  Code of method:</p>
  
  <pre><code>public IEnumerator&lt;int&gt; GetEnumerator()
  {
      yield return 1;
  
      Console.WriteLine("1");
  
      yield return 2;
  }
  </code></pre>
  
  <p>I just what to know how it can be implemented manually.</p>