title: How do I correctly wrap a Dictionary<T,U> and expose an enumerator?
body: <p>I am encapsulating a Dictionary in my object.  How do I expose IEnumerable>? </p>
  
  <p>Before</p>
  
  <pre><code>class HashRunningTotalDB : Dictionary&lt;int, SummaryEntity&gt;
  {
           /... 
  } 
  
  // WORKS!
  static void Main ()
  {
         HashRunningTotalDB  tempDB = new HashRunningTotalDB();
         //todo: load temp DB
  
         foreach(var item in tempDB)
         {
             Console.Writeline(item.Key + " " + item.Value.SomeProperty);
         }
  }
  </code></pre>
  
  <p><strong>After</strong></p>
  
  <pre><code>class HashRunningTotalDB : IEnumerable
  {
      Dictionary&lt;int, SummaryEntity&gt; thisHashRunningTotalDB = new Dictionary&lt;int, SummaryEntity&gt;();
  
        //QUESTION:  HOW DO I IMPLEMENT THE GENERIC ENUMERATOR HERE?
      // The following doesn't behave the same as the previous implementation
       IEnumerator IEnumerable.GetEnumerator()
      {
          return thisHashRunningTotalDB.GetEnumerator();
      }
  
  
      // The following doesn't compile
       Dictionary&lt;int, SummaryEntity&gt;.Enumerator IEnumerable&lt;Dictionary&lt;int, SummaryEntity&gt;&gt;.GetEnumerator()
      {
          return thisHashRunningTotalDB.GetEnumerator();
      }
  } 
  
  
  
  static void Main ()
  {
         HashRunningTotalDB  tempDB = new HashRunningTotalDB();
         //todo: load temp DB
  
  
         // NOT WORKING
         foreach(var item in tempDB)
         {
             Console.Writeline(item.Key + " " + item.Value.SomeProperty);
         }
  }
  </code></pre>